Release 10 Release date: 2017-09-XX (CURRENT AS OF 2017-05-14) Overview Major enhancements in PostgreSQL 10 include: The above items are explained in more detail in the sections below. Migration to Version 10 A dump/restore using , or use of , is required for those wishing to migrate data from any previous release. Version 10 contains a number of changes that may affect compatibility with previous releases. Observe the following incompatibilities: pg_upgrade-ed hash indexes from previous major Postgres versions must be rebuilt. Major hash storage improvements necessitated this requirement. Change the default log directory from pg_log to log (Andreas Karlsson) Rename pg_xlog to pg_wal (Michael Paquier) This prevents the write-ahead log directory from being confused as containing server activity logs, and erroneously truncated. Rename SQL functions, tools, and options that reference xlog to wal (Robert Haas) For example, pg_switch_xlog() becomes pg_switch_wal(), pg_receivexlog becomes pg_receivewal, and Rename transaction status directory pg_clog directory to pg_xact (Michael Paquier) Rename WAL-related functions and views to use lsn instead of location (David Rowley) RenameWAL-related functions and views to use lsn instead of location (David Rowley) Allow COALESCE and CASE to return multiple rows when evaluating set-returning functions (Andres Freund). This also prevents conditionals like CASE from controlling the execution of set-returning functions because set-returning functions are now executed earlier. Have stream the WAL needed to restore the backup by default (Magnus Hagander) This changes the pg_basebackup Make all actions wait by default for completion (Peter Eisentraut) Previously some pg_ctl actions didn't wait for completion, and required the use of Remove the ability to store unencrypted passwords on the server (Heikki Linnakangas) The server-side variable no longer supports off or plain. The UNENCRYPTED option is no longer supported for CREATE/ALTER USER ... PASSSWORD. Similarly, the Allow multi-dimensional arrays to be passed into PL/Python functions, and returned as nested Python lists (Alexey Grishchenko, Dave Cramer, Heikki Linnakangas) This makes a backwards-incompatible change to the handling of composite types in arrays. Previously, you could return an array of composite types as "[[col1, col2], [col1, col2]]", but now that is interpreted as a two- dimensional array. Composite types in arrays must now be returned as Python tuples, not lists, to resolve the ambiguity. I.e. "[(col1, col2), (col1, col2)]". See the documentation for more details. CLARIFY Remove PL/Tcl's "module" auto-loading facility (Tom Lane) Replaced by new PL/Tcl startup GUCs. Remove sql_inheritance GUC (Robert Haas) Changing this from the default value caused queries referencing parent tables to not include children tables. The SQL standard requires such behavior and this has been the default since Postgres 7.1. Add GUCs and to control parallel operation (Amit Kapila, Robert Haas) This replaces min_parallel_relation_size, which was too generic. Remove pg_dump/pg_dumpall support for dumping from pre-8.0 servers (Tom Lane) Users needing dump support for pre-8.0 servers need to use dump binaries from Postgres 9.6. Remove support for floating-point datetimes/timestamps (Tom Lane) This removes configure's Remove support for client/server protocol version 1.0 (Tom Lane) This protocol hasn't had client support since Postgres 6.3. Remove contrib/tsearch2 (Robert Haas) This removes compatibility with the contrib version of full text search that shipped in pre-8.3 Postgres versions. Remove createlang and droplang command-line applications (Peter Eisentraut) Remove support for version-0 function calling conventions (Andres Freund) Remove SCO and Unixware ports (Tom Lane) Changes Below you will find a detailed account of the changes between PostgreSQL 10 and the previous major release. Server Parallel Queries Support parallel btree index scans (Rahila Syed, Amit Kapila, Robert Haas, Rafia Sabih) Allows btree index pages to be checked by separate parallel workers. Support parallel bitmap heap scans (Dilip Kumar) This allows a single index scan to dispatch parallel workers to process different areas of the heap. Allow merge joins to be performed in parallel (Dilip Kumar) Allow non-correlated subqueries to be run in parallel (Amit Kapila) Improve ability of parallel workers to return pre-sorted data (Rushabh Lathia) Increase parallel query usage in procedural language functions (Robert Haas, Rafia Sabih) Add GUC to limit the number of worker processes that can be used for query parallelism (Julien Rouhaud) This can be set lower than to reserve worker processes for purposes other than parallel queries. Indexes Add SP-GiST index support for INET and CIDR data types (Emre Hasegeli) These data types already had GiST support. Reduce page locking during vacuuming of GIN indexes (Andrey Borodin) Add option to allow BRIN index summarization to happen more aggressively (Álvaro Herrera) Specifically, a new CREATE INDEX option allows auto-summarizion of the previous BRIN page range when a new page range is created. Add functions to remove and re-add BRIN summarization for BRIN index ranges (Álvaro Herrera) New SQL function brin_summarize_range() updates BRIN index summarization for a specified range and brin_desummarize_range() removes it. This is helpful to update summarization of a range that is now smaller due to UPDATEs and DELETEs. Improve accuracy in determining if a BRIN index scan is beneficial (David Rowley, Emre Hasegeli) Allow faster GiST inserts and updates by reusing index space more efficiently (Andrey Borodin) <link linkend="indexes-types">Hash Indexes</link> Add write-ahead logging support to hash indexes (Amit Kapila) This makes hash indexes crash-safe and replicated, and removes the warning message about their use. Improve hash bucket split performance by reducing locking requirements (Amit Kapila, Mithun Cy) Also cache hash index meta-information for faster lookups. Improve efficiency of hash index growth (Amit Kapila, Mithun Cy) Allow single-page hash pruning (Ashutosh Sharma) Locking Only check for REFERENCES permission on referenced tables (Tom Lane) Previously REFERENCES permission on the referencing table was also required. Reduce locking required for adding values to enum types (Andrew Dunstan, Tom Lane) Previously it was impossible to run ALTER TYPE ... ADD VALUE in a transaction block unless the enum type was created in the same block. Now, only references to uncommitted enum values from other transactions is prohibited. Allow tuning of predicate lock promotion thresholds (Dagfinn Ilmari Mannsåker) The new settings are and . Optimizer Add multi-column optimizer statistics to compute the correlation ratio and number of distinct values (Tomas Vondra, David Rowley, Álvaro Herrera) New commands are CREATE, ALTER, and DROP STATISTICS. This is helpful in estimating query memory usage and when combining the statistics from individual columns. Improve planner matching of boolean indexes (Tom Lane) Improve performance of queries referencing row-level security restrictions (Tom Lane) The optimizer now has more flexibility in reordering executor behavior. General Performance Speed up SUM() calculations (Heikki Linnakangas) This uses an optimized numeric accumulator. Improve the performance of character encoding conversions by using radix trees (Kyotaro Horiguchi, Heikki Linnakangas) Reduce the function call overhead during query execution (Andres Freund) This is particularly helpful for queries that process many rows. Improve the performance of grouping sets (Andrew Gierth) Use uniqueness guarantees to optimize certain join types (David Rowley) Improve sort performance of the macaddr data type (Brandur Leach) Reduce statistics tracking overhead in sessions that reference many thousands of relations (Aleksander Alekseev) Monitoring Create a pg_sequence system catalog to store sequence metadata (Peter Eisentraut) Sequence metadata includes start, increment, etc, which is now transactional. Sequence counters are still stored in separate heap relations. Also add pg_sequences view to show all sequences. Allow explicit control over EXPLAIN's display of planning and execution time (Ashutosh Bapat) By default planning and execution time are displayed by EXPLAIN ANALYZE and are not displayed in other cases. The new EXPLAIN option SUMMARY allows explicit control of this. Properly update the statistics collector during REFRESH MATERIALIZED VIEW (Jim Mlodgenski) Add default monitoring roles (Dave Page) New roles pg_monitor, pg_read_all_settings, pg_read_all_stats, and pg_stat_scan_tables allow simplified permission configuration. Logging Change default to include current timestamp with milliseconds and the process id (Christoph Berg) The previous default was not to output a prefix. Add functions to return the log and WAL directory names (Dave Page) The new functions are pg_ls_logdir() and pg_ls_waldir() and can be executed by non-super users with the proper permissions. Add function pg_current_logfile() to read syslog's current stderr and csvlog output file names (Gilles Darold) Report the address and port number of successful startup socket binding in the server logs (Tom Lane) Also, report bind socket failure details in the server logs. Reduce log chatter about the starting and stopping of launcher subprocesses (Tom Lane) These are now DEBUG1-level messages. Reduce message verbosity of lower-numbered debug levels controlled by (Robert Haas) This also changes the verbosity of debug levels. <link linkend="pg-stat-activity-view"><structname>pg_stat_activity</></link> Add pg_stat_activity reporting of latch wait states (Michael Paquier, Robert Haas) This includes the remaining wait events, like client reads, client writes, and synchronous replication. Add pg_stat_activity reporting of waits on reads, writes, and fsyncs (Rushabh Lathia) Show auxiliary processes and background workers in pg_stat_activity (Kuntal Ghosh) New column backend_type identifies the process type. Display walsender processes in pg_stat_activity (Michael Paquier) This simplifies monitoring. Allow pg_stat_activity to show the source query being executed by parallel workers (Rafia Sabih) Rename pg_stat_activity.wait_event_type values LWLockTranche and LWLockNamed to LWLock (Robert Haas) This makes the output more consistent. <acronym>Authentication</> Add SCRAM-SHA-256 support for password negotiation and storage (Michael Paquier, Heikki Linnakangas) This provides better security than the existing md5 negotiation and storage method. Change GUC from boolean to enum (Michael Paquier) This was necessary to support additional password hashing options. Add view pg_hba_file_rules to display the contents of pg_hba.conf (Haribabu Kommi) This shows the file contents, not the currently active settings. Support multiple RADIUS servers (Magnus Hagander) All the RADIUS related parameters are now plural and support a comma-separated list of servers. Server Configuration Allow SSL configuration to be updated during configuration reload (Andreas Karlsson, Tom Lane) This allows SSL to be reconfigured without a server restart by using pg_ctl reload, SELECT pg_reload_conf(), or sending a SIGHUP signal. Reload SSL configuration updates do not work if the SSL key requires a passphrase. Remove documented restriction about using large shared buffers on Windows (Takayuki Tsunakawa) Reduce locking required to change table params (Simon Riggs, Fabrízio Mello) For example, changing a table's setting can now be done with a more lightweight lock. Make the maximum value of effectively unlimited (Jim Nasby) Reliability Perform an fsync on the directory after creating or unlinking files (Michael Paquier) This reduces the risk of data loss after a power failure. <link linkend="wal">Write-Ahead Log</> (<acronym>WAL</>) Prevent checkpoints and WAL archiving on otherwise-idle systems (Michael Paquier) Add GUC to add details to WAL that can be sanity-checked on the standby (Kuntal Ghosh, Robert Haas) Any sanity-check failure generates a fatal error on the standby. Increase the maximum configurable WAL segment size to one gigabyte (Beena Emerson) Larger WAL segment sizes allows for fewer invocations and fewer WAL files to manage. Replication and Recovery Add the ability to logically replicate tables to standby servers (Petr Jelinek) This allows more fine-grained replication options, including replication between different major versions of Postgres and selective-table replication. Allow waiting for commit acknowledgement from standby servers irrespective of the order they appear in (Masahiko Sawada) Previously the server always waited for the active standbys that appeared first in synchronous_standby_names. The new synchronous_standby_names keyword ANY allows waiting for any number of standbys irrespective of their ordering. This is known as quorum commit. Reduce configuration necessary to perform streaming backup and replication (Magnus Hagander) Specifically, defaults were changed for , , , and . Enable replication from localhost connections by default in pg_hba.conf (Michael Paquier) Previously pg_hba.conf's replication connection lines were commented out. This is particularly useful for . Add columns to pg_stat_replication to report replication delay times (Thomas Munro) The new columns are write_lag, flush_lag, and replay_lag. Add specification of a Log Sequence Number (LSN) stopping point in recovery.conf (Michael Paquier) Previously only specification of the stop name, time, timeline, xid, and immediate were supported. Allow users to disable pg_stop_backup()'s waiting for all WAL to be archived (David Steele) An optional second argument to pg_stop_backup() controls that behavior. Allow creation of temporary replication slots (Petr Jelinek) Temporary slots are automatically removed on session exit or error. Improve performance of hot standby replay with better tracking of Access Exclusive locks (Simon Riggs, David Rowley) Speed up two-phase commit recovery performance (Stas Kelvich, Nikhil Sontakke, Michael Paquier) Queries Add XMLTABLE function that converts XML-formatted data into a row set (Pavel Stehule, Álvaro Herrera) Allow ROW to supply values to UPDATE ... SET (column_list) (Tom Lane) Also allow row values to be supplied by table.*. Fix regular expression locale class handling for bytes greater than U+7FF (Tom Lane) Previously such classes were not recognized. Utility Commands Add table partitioning syntax that automatically creates partition constraints and INSERT routing (Amit Langote) The syntax supports range and list partitioning. Add AFTER trigger transition table to record changed rows (Kevin Grittner) Transition table contents are accessible from server-side languages. Allow restrictive row-level security policies (Stephen Frost) Previously all security policies were permissive, meaning that any matching policy allowed access. Optional restrictive policies must match for access to be granted. These policy types can be combined. Allow default permissions on schemas (Matheus Oliveira) This is done using the ALTER DEFAULT PRIVILEGES command. Add CREATE SEQUENCE AS command to create a sequence matching an integer data type (Peter Eisentraut) This simplifies the creation of sequences matching the range of base columns. Allow COPY view FROM on views with INSTEAD INSERT triggers (Haribabu Kommi) The triggers are fed the rows from COPY. Allow the specification of a function name without arguments in DDL commands, when unique (Peter Eisentraut) For example, allow DROP FUNCTION on a function name without arguments if there is only one function with that name. This is required by the SQL standard. Allow multiple functions, operators, and aggregates to be dropped with a single DROP command (Peter Eisentraut) Add IF NOT EXISTS for CREATE SERVER and CREATE USER MAPPING (Anastasia Lubennikova) Add IF NOT EXISTS clause to CREATE COLLATION (Peter Eisentraut) Have VACUUM VERBOSE report the number of skipped frozen pages and oldest xmin (Masahiko Sawada, Simon Riggs) This information is also included in output. Improve speed of VACUUM's removal of trailing empty heap pages (Claudio Freire, Álvaro Herrera) This information is also included in output. Fix check_srf_call_placement() to handle VALUES cases correctly (Tom Lane) NEED TEXT. Data Types Add full text search support for JSON and JSONB (Dmitry Dolgov) This is accessed via ts_headline() and to_tsvector. Add support for EUI-64 MAC addresses as MACADDR8 (Haribabu Kommi) This complements support for EUI-48 MAC addresses as macaddr. Add identity columns for assigning a numeric value to columns on insert (Peter Eisentraut) These are similar to SERIAL columns, but are SQL standard compliant. Allow ENUM values to be renamed (Dagfinn Ilmari Mannsåker) This uses the syntax ALTER TYPE ... RENAME VALUE. Properly treat array pseudotypes (anyarray) as arrays in to_json() and to_jsonb() (Andrew Dunstan) Previously "anyarray" values were converted to JSON strings. Add MONEY operators for multiplication and division with INT8 values (Peter Eisentraut) More strictly check the MONEY type for overflow operations (Peter Eisentraut) Functions Add simplified regexp_match() function (Emre Hasegeli) Similar to regexp_matches(), but only returns results from the first match so it is easier use for simple cases. Add version of jsonb's delete operator that takes an array of keys to delete (Magnus Hagander) The JSONB delete operator also now supports arrays. Improve json_populate_record and friends operate recursively (Nikita Glukhov) CLARIFY Add function txid_current_ifassigned() to return NULL if no transaction id has been assigned (Craig Ringer) This is different from txid_current(), which always returns a transaction id by assigning one if necessary. This can be also run on standby servers. Add function txid_status() to check if a transaction was committed (Craig Ringer) This is useful for checking after an abrupt disconnection if your previous transaction committed and you just didn't receive the acknowledgement. Allow make_date() to interpret negative years as BC years (Álvaro Herrera) Have to_timestamp() and to_date() check input values for validity (Artur Zakirov) Previously to_date('2009-06-40','YYYY-MM-DD') was accepted and returned '2009-07-10'. It will now generate an error. Server-Side Languages Allow the PL/Python plan object to call cursor and execute methods (Peter Eisentraut) This is a more object oriented style. Allow PL/pgSQL's GET DIAGNOSTICS to retrieve values into array elements (Tom Lane) Remove SPI functions SPI_push(), SPI_pop(), SPI_restore_connection() as unnecessary (Tom Lane) Their functionality now happens automatically. Also, SPI_palloc() now requires an active connection. <link linkend="pltcl">PL/Tcl</> Allow PL/Tcl functions to return composite types and sets (Jim Nasby) Add a subtransaction command to PL/Tcl (Victor Wagner) This allows PL/Tcl queries to fail without aborting the entire function. Add GUCs to allow initialization routines to be called on PL/Tcl startup (Tom Lane) The GUCs are pltcl.start_proc and pltclu.start_proc. Client Interfaces Allow libpq to connect to multiple specified host names (Robert Haas) libpq will connect with the first responsive host name. Allow the libpq connection string to request a read/write host (Victor Wagner, Mithun Cy) This is useful when multiple libpq host names are specified, and is controlled by libpq connection parameter Allow password file name to be specified as a libpq connection parameter (Julian Markwort) Previously this could only be specified via an environment variable. Add function PQencryptPasswordConn() to allow creation of more types of encrypted passwords on the client-side (Michael Paquier, Heikki Linnakangas) Previously only MD5 passwords could be created using PQencryptPassword(). This new function can also create SCRAM-SHA-256 passwords. ecpg preprocessor version changed from 4.12 to 10 (Tom Lane) The ecpg version now matches the Postgres distribution version number. Client Applications <xref linkend="APP-PSQL"> Add conditional branch support to psql (Corey Huinker) The new syntax uses \if, \elif, \else, and \endif. This is particularly helpful for scripting. Add psql \gx command to perform \g(execute) in expanded mode (\x) (Christoph Berg) Improve psql's \d (relation) and \dD (domain) commands to specify collation, nullable, and default in separate columns (Peter Eisentraut) Previous they were in a single "Modifiers" column. Expand psql colon variables when used in backtick-executed contexts (Tom Lane) This is particularly useful for the new psql conditional branch support commands. Prevent psql special variables from being set to invalid values (Daniel Vérité, Tom Lane) Previously setting psql special variables to invalid values produced the default behavior. \set and \unset of special variables now sets them to "on" and its default value, rather than a zero-length string and undefined. Also have \set always display values for FETCH_COUNT, HISTSIZE, and IGNOREEOF. Improve psql's tab completion (Jeff Janes, Ian Barwick, Andreas Karlsson, Sehrope Sarkuni, Thomas Munro, Kevin Grittner, Dagfinn Ilmari Mannsåker) <xref linkend="pgbench"> Add pgbench option Allow pgbench's meta commands to span multiple lines via a line-terminating backslash (Fabien Coelho) Server Applications Add pg_receivewal option Add pg_recvlogical option ( This complements the existing Rename initdb options The old spellings are still supported. <link linkend="APP-PGDUMP"><application>pg_dump</></>, <link linkend="APP-PG-DUMPALL"><application>pg_dumpall</></>. <link linkend="APP-PGRESTORE"><application>pg_restore</></> Allow pg_restore to exclude schemas (Michael Banck) This added a new Add This suppresses the dumping of large objects. Add pg_dumpall option This allows easier dumping for less-privileged users. Issue fsync on the output files generated by pg_dump and pg_dumpall (Michael Paquier) This can be disabled with the <xref linkend="app-pgbasebackup"> Allow pg_basebackup to stream write-ahead log in tar mode (Magnus Hagander) The WAL will be stored in a separate tar file from the base backup. Make pg_basebackup use temporary replication slots (Magnus Hagander) Temporary replication slots will be used by default when pg_basebackup uses wal streaming with default options. Improve fsync handling of pg_basebackup and pg_receivewal (Michael Paquier) Also add Improve pg_basebackup's handling of which directories to skip (David Steele) Also improve the documentation of skipped directories. <application><xref linkend="app-pg-ctl"></> Add wait option for 's promote operation (Peter Eisentraut) Add long options for pg_ctl wait ( Add long options flag for pg_ctl options (Peter Eisentraut) It is called Source Code New major version numbering (Peter Eisentraut, Tom Lane) Major versions will now increase just the first number, and minor releases will increase just the second number. A third number will no longer be used in Postgres version numbers. Allow the ICU library to optionally be used for collation support (Peter Eisentraut) The ICU library has versioning that allows detection of collation changes between versions. It is enabled via configure option Automatically mark all PG_FUNCTION_INFO_V1 functions as DLLEXPORT-ed on Windows (Laurenz Albe) If third-party code is using extern function declarations, they should also add DLLEXPORT markers to those declarations. Allow shared memory to be dynamically allocated (Thomas Munro, Robert Haas) Add slab-like memory allocator for efficient fixed-size allocations (Tomas Vondra) Use POSIX semaphores rather than SysV semaphores on Linux and FreeBSD (Tom Lane) This avoids some limits on SysV semaphore usage. Improve support for 64-bit atomics (Andres Freund) Enable 64-bit atomic operations on ARM64 (Roman Shaposhnik) Switch to using clock_gettime(), if available, for duration measurements (Tom Lane) gettimeofday() is used if clock_gettime() is not available. Add more robust random number generators to be used for cryptographic secure uses (Magnus Hagander, Michael Paquier, Heikki Linnakangas) If no strong random number generator can be found, configure will fail unless the configure Overhaul documentation build process (Alexander Lakhin, Alexander Law) Use XSLT to build the Postgres documentation (Peter Eisentraut) Previously Jade, DSSSL, and JadeTex were used. Build HTML documentation using XSLT stylesheets by default (Peter Eisentraut) Additional Modules Allow file_fdw to read from program output as well as files (Corey Huinker, Adam Gomaa) Push aggregates to foreign data wrapper servers, where possible (Jeevan Chalke, Ashutosh Bapat) This reduces the amount of data that must be passed from the foreign data wrapper server, and offloads aggregate computation from the requesting server. The postgres_fdw is able to perform this optimization. There are also improvements in pushing down joins involving extensions. Allow push down of FULL JOIN queries containing subqueries in the FROM clause to foreign servers (Etsuro Fujita) Properly support OID columns in postgres_fdw tables (Etsuro Fujita) Previously OID columns always returned zeros. Allow btree_gist and btree_gin to index enum types (Andrew Dunstan) This allows enums to be used in exclusion constraints. Add indexing support to btree_gist for the UUID data type (Paul Jungwirth) Add amcheck which can check the validity of btree indexes (Peter Geoghegan) Show ignored constants as $N rather than ? in pg_stat_statements (Lukas Fittl) Improve cube's handling of zero-dimensional cubes (Tom Lane) This also improves handling of infinite and NaN values. Allow pg_buffercache to run with fewer locks (Ivan Kartyshov) This allows it be less disruptive when run on production systems. Add pgstathashindex() function to pgstattuple to view hash index statistics (Ashutosh Sharma) Allow pgstattuple to use GRANT permissions (Stephen Frost) This allows non-superusers to run these functions if permissions allow. Reduce locking when pgstattuple examines hash indexes (Amit Kapila) Add page_checksum() function to pageinspect (Tomas Vondra) Add hash index support to pageinspect (Jesper Pedersen, Ashutosh Sharma) Add pageinspect function bt_page_items() to print page items from a page image (Tomas Vondra) Previously only block numbers were supported.