E.1. Release 9.5

Release Date: 2015-??-??

Current as of 2015-08-03

E.1.1. Overview

Major enhancements in PostgreSQL 9.5 include:

The above items are explained in more detail in the sections below.

E.1.2. Migration to Version 9.5

A dump/restore using pg_dumpall, or use of pg_upgrade, is required for those wishing to migrate data from any previous release.

Version 9.5 contains a number of changes that may affect compatibility with previous releases. Observe the following incompatibilities:

E.1.3. Changes

Below you will find a detailed account of the changes between PostgreSQL 9.5 and the previous major release.

E.1.3.1. Server

E.1.3.1.1. Indexes

  • Add Block Range Indexes (BRIN) (Álvaro Herrera, Heikki Linnakangas, Emre Hasegeli)

    BRIN indexes are very compact and cheap to update by storing min/max values for a range of heap blocks.

  • Allow queries to perform accurate distance filtering of bounding-box-indexed objects (polygons, circles) using GiST indexes (Alexander Korotkov, Heikki Linnakangas)

    Previously, a common table expression was required to return a large number of rows ordered by bounding-box distance, and then filtered further with a more accurate non-bounding-box distance calculation.

  • Allow GiST indexes to perform index-only scans (Anastasia Lubennikova, Heikki Linnakangas, Andreas Karlsson)

  • Add configuration parameter gin_pending_list_limit to control the size of GIN pending lists (Fujii Masao)

    Previously the list size was controlled by work_mem. This can also be set as an index storage parameter.

  • Issue a warning during the creation of hash indexes because they are not crash-safe (Bruce Momjian)

E.1.3.1.2. General Performance

  • Improve the speed of sorting character and numeric fields (Peter Geoghegan, Andrew Gierth, Robert Haas)

  • Extend the infrastructure that allows sorting to be performed by inlined, non-SQL-callable comparison functions to cover CREATE INDEX, REINDEX, and CLUSTER (Peter Geoghegan)

  • Improve in-memory hash performance (Tomas Vondra, Robert Haas)

  • Improve concurrency of shared buffer replacement (Robert Haas, Amit Kapila)

  • Reduce the number of page locks and pins during index scans (Kevin Grittner)

    The primary benefit of this is to allow index vacuums to be blocked less often.

  • Make backend local tracking of buffer pins memory efficient (Andres Freund)

    Previously each session allocated an array with space for every buffer in shared_buffers.

  • Improve lock scalability (Andres Freund)

    This particularly addresses scalability problems when running on systems with multiple CPU sockets.

  • Allow the optimizer to remove unnecessary references to left outer join subqueries (David Rowley)

  • Allow pushdown of query restrictions into window functions, where appropriate (David Rowley)

  • Speed up CRC (cyclic redundancy check) computations (Abhijit Menon-Sen, Heikki Linnakangas)

  • Improve bitmap index scan performance (Teodor Sigaev, Tom Lane)

  • Speed up CREATE INDEX by avoiding unneccessary memory copies (Robert Haas)

E.1.3.1.3. Monitoring

  • Add per-table autovacuum logging control via log_min_autovacuum_duration (Michael Paquier)

    NOT DOCUMENTED?

  • Add new configuration parameter cluster_name (Thomas Munro)

    This string, typically set in postgresql.conf, allows clients to identify the cluster. This name also appears in the process title of all server processes, allowing for easier identification of processes belonging to the same cluster.

  • Prevent non-superusers from changing log_disconnections on connection startup (Fujii Masao)

E.1.3.1.4. SSL

  • Check "Subject Alternative Names" in SSL server certificates, if present (Alexey Klyukin)

    When they are present, this replaces checks against the certificate's "Common Name".

  • Add system view pg_stat_ssl to report SSL connection information (Magnus Hagander)

  • Add libpq function PQsslAttribute() that returns SSL information (Heikki Linnakangas)

    While PQgetssl() can still be used to call OpenSSL functions, PQsslAttribute() returns SSL information in an SSL-implementation-independent way. (Future versions of libpq might support other SSL implementations.)

  • Make libpq honor any OpenSSL thread callbacks (Jan Urbanski)

    Previously they were overwritten.

E.1.3.1.5. Server Settings

  • Replace configuration parameter checkpoint_segments with min_wal_size and max_wal_size (Heikki Linnakangas)

    This allows the allocation of a large number of WAL files without keeping them if they are not needed. Thus the default for max_wal_size has been increased to 1GB.

  • Add configuration parameter wal_compression to control compression of full page images stored in WAL (Rahila Syed, Michael Paquier)

  • Allow recording of transaction commit timestamps when configuration parameter track_commit_timestamp is enabled (Álvaro Herrera, Petr Jelínek)

    Timestamp information can be accessed using functions pg_xact_commit_timestamp() and pg_last_committed_xact().

  • Allow local_preload_libraries to be set by ALTER ROLE SET (Peter Eisentraut, Kyotaro Horiguchi)

  • Allow running autovacuum workers to respond to configuration parameter changes (Michael Paquier)

  • Make configuration parameter debug_assertions read-only (Andres Freund)

    This means that assertions can no longer be turned off if they were enabled at compile time, allowing for more efficient code optimization. This change also removed the postgres -A option.

  • Allow setting effective_io_concurrency on systems where it has no effect (Peter Eisentraut)

  • Add environment variables PG_OOM_ADJUST_FILE and PG_OOM_ADJUST_VALUE to help control the Linux OOM killer (Gurjeet Singh)

    The previous OOM control infrastructure involved a compile-time option.

  • Add system view pg_file_settings to show the contents of the server's configuration files (Sawada Masahiko)

  • Add pending_restart to the system view pg_settings to indicate a change is pending a restart (Peter Eisentraut)

  • Allow ALTER SYSTEM values to be reset with ALTER SYSTEM RESET (Vik Fearing)

    This command removes the setting from postgresql.auto.conf.

E.1.3.2. Replication and Recovery

  • Add recovery.conf parameter recovery_target_action to control post-recovery activity (Petr Jelínek)

    This replaces the old parameter pause_at_recovery_target.

  • Add new archive_mode value always to allow standbys to always archive received WAL files (Fujii Masao)

  • Add configuration parameter wal_retrieve_retry_interval to control WAL read retry after failure (Alexey Vasiliev, Michael Paquier)

    This is particularly helpful for warm standbys.

  • Archive WAL files with suffix .partial during standby promotion (Heikki Linnakangas)

  • Add configuration parameter log_replication_commands to log replication commands (Fujii Masao)

    By default, replication commands, e.g. IDENTIFY_SYSTEM, are not logged, even when log_statement is set to all.

  • Allow labeling of the origin of logical replication changes (Andres Freund)

    This helps with change tracking.

  • Report the processes holding replication slots in pg_replication_slots (Craig Ringer)

    The new output column is active_pid.

  • Allow recovery.conf's primary_conninfo to use connection URIs, e.g. postgres:// (Alexander Shulgin)

E.1.3.3. Queries

  • Allow INSERTS that would generate constraint conflicts to be turned into UPDATEs or ignored (Peter Geoghegan, Heikki Linnakangas, Andres Freund)

    The syntax is INSERT ... ON CONFLICT DO NOTHING/UPDATE. This is the Postgres implementation of the popular UPSERT command.

  • Add GROUP BY analysis functions GROUPING SETS, CUBE and ROLLUP (Andrew Gierth, Atri Sharma)

  • Allow to set multiple columns in an UPDATE to the result of a single subselect (Tom Lane)

    This is accomplished using the syntax UPDATE tab SET (col1, col2, ...) = (SELECT ...).

  • Add new SELECT option SKIP LOCKED to skip locked rows (Thomas Munro)

    This does not throw an error for locked rows like NOWAIT does.

  • Add SELECT option TABLESAMPLE to return a subset of a table (Petr Jelínek)

  • Suggest possible matches for mistyped column names (Peter Geoghegan, Robert Haas)

E.1.3.4. Utility Commands

  • Add more details about sort ordering in EXPLAIN output (Marius Timmer, Lukas Kreft, Arne Scheffer)

    Details include COLLATE, DESC, USING, and NULLS FIRST/LAST.

  • Have VACUUM log the number of pages skipped due to pins (Jim Nasby)

  • Have TRUNCATE properly update the pg_stat* tuple counters (Alexander Shulgin)

E.1.3.4.1. REINDEX

  • Allow REINDEX to reindex an entire schema using the SCHEMA option (Sawada Masahiko)

  • Add VERBOSE option to REINDEX (Sawada Masahiko)

  • Prevent REINDEX DATABASE and SCHEMA from outputting object names, unless VERBOSE is used (Simon Riggs)

  • Remove obsolete FORCE option from REINDEX (Fujii Masao)

E.1.3.5. Object Manipulation

E.1.3.5.1. CREATE FOREIGN DATA WRAPPER

  • Add support for IMPORT FOREIGN SCHEMA (Ronan Dunklau, Michael Paquier, Tom Lane)

    This command allows automatic creation of local foreign tables that match the structure of existing tables on a remote server.

  • Allow foreign tables to participate in inheritance (Shigeru Hanada, Etsuro Fujita)

    This also allows foreign tables to mark check constraints as not valid, and to set storage and OID characteristics.

  • Allow CHECK constraints to be placed on foreign tables (Shigeru Hanada, Etsuro Fujita)

    These constraints are assumed to be enforced on the remote server, and are not enforced locally. However, they are assumed to hold for purposes of query optimization, such as constraint exclusion.

  • Allow foreign data wrappers and custom scans to implement join pushdown (KaiGai Kohei)

E.1.3.5.2. CREATE EVENT TRIGGER

E.1.3.6. Data Types

  • Allow the XML data type to accept empty or all-whitespace values (Peter Eisentraut)

    This is required by the SQL/XML specification.

  • Fix XML xpath() handling to return namespace declarations even if the namespace is in a parent element (Ali Akbar)

    Previously the namespace was not returned, potentially leading to invalid XML.

  • Allow MACADDR input using the format xxxx-xxxx-xxxx (Herwin Weststrate)

  • Tighten syntax of INTERVAL precision specifications (Bruce Momjian)

    Only allow interval precision to be specified after the INTERVAL keyword if no units are specified.

  • Add selectivity estimators for INET/CIDR operators and improve estimators for text search functions (Emre Hasegeli, Tom Lane)

E.1.3.6.1. JSON

E.1.3.7. Functions

  • Add generate_series() for NUMERIC values (Plato Malugin)

  • Allow array_agg() and ARRAY() to take arrays as inputs (Ali Akbar, Tom Lane)

  • Add functions array_position() and array_positions() to return subscripts of array values (Pavel Stehule)

  • Add point-to-polygon distance operator (<->) (Alexander Korotkov)

  • Allow multi-byte characters as escape in SIMILAR TO and SUBSTRING (Jeff Davis)

    Previously, only a single-byte character was allowed as an escape.

  • Add a width_bucket() variant that supports any sortable data type and non-uniform bucket widths (Petr Jelínek)

  • Add an optional missing_ok argument to pg_read_file() and related functions (Michael Paquier, Heikki Linnakangas)

  • Allow => to specify named parameters in function calls (Pavel Stehule)

    Previously only := could be used. This requires removing the possibility for => to be a user-defined operator. Creation of user-defined => operators has been issuing warnings since Postgres 9.0.

  • Add POSIX-compliant rounding for platforms that use Postgres-supplied rounding functions (Pedro Gimeno Fortea)

E.1.3.7.1. System Information Functions and Views

E.1.3.7.2. Aggregates

  • Add MIN()/MAX() aggregates for INET/CIDR data types (Haribabu Kommi)

  • Use 128-bit integers, where supported, as aggregate accumulators (Andreas Karlsson)

E.1.3.8. Server-Side Languages

  • Improve support for composite types in PL/Python (Ed Behn, Ronan Dunklau)

    This allows PL/Python functions to return arrays of composite types.

  • Reduce lossiness of PL/Python floating value conversions (Marko Kreen)

  • Allow specification of conversion routines between SQL data types and data types of procedural languages (Peter Eisentraut)

    This change adds new commands CREATE/DROP TRANSFORM. This also adds optional transformations between the hstore and ltree types to/from PL/Perl and PL/Python.

E.1.3.8.1. PL/pgSQL Server-Side Language

  • Improve PL/pgSQL array performance (Tom Lane)

  • Add ASSERT statement in PL/pgSQL (Pavel Stehule)

  • Allow more PL/pgSQL keywords to be used as identifiers (Tom Lane)

E.1.3.9. Client Applications

  • Move pg_archivecleanup, pg_test_fsync, pg_test_timing, and pg_xlogdump from contrib to src/bin (Peter Eisentraut)

  • Add pg_rewind, which allows re-synchronizing a master server after failback (Heikki Linnakangas)

  • Allow pg_receivexlog to manage physical replication slots (Michael Paquier)

    This is controlled via new --create-slot and --drop-slot options.

  • Allow the pg_receivexlog to synchronously flush WAL to storage using --synchronous (Furuya Osamu, Fujii Masao)

    Without this, WAL files are fsynced only on close.

  • Allow vacuumdb to vacuum in parallel using --jobs (Dilip Kumar)

  • Add --verbose option to reindexdb (Sawada Masahiko)

  • Make pg_basebackup use a tablespace mapping file when using tar format, to support symbolic links and file paths of 100+ characters in length on MS Windows (Amit Kapila)

  • Add pg_xlogdump option --stats to display summary statistics (Abhijit Menon-Sen)

E.1.3.9.1. psql

  • Allow psql to produce AsciiDoc output (Szymon Guz)

  • Add errors mode to psql's ECHO variable to display only failed commands (Pavel Stehule)

    This can also be enabled with the psql -b option.

  • Allow column, header, and border control to psql's Unicode style (Pavel Stehule)

    Single or double output is supported; the default is single.

  • Add psql PROMPT variables option (%l) to display the multi-line statement line number (Sawada Masahiko)

  • Add psql setting pager_min_lines to control pager invocation (Andrew Dunstan)

  • Improve psql line counting used when deciding to invoke the pager (Andrew Dunstan)

  • Add psql tab completion when setting the search_path variable (Jeff Janes)

    Currently only the first schema can be tab-completed.

  • Improve psql's tab completion for triggers and rules (Andreas Karlsson)

E.1.3.9.1.1. Backslash Commands

  • Add psql \? help sections variables and options (Pavel Stehule)

    variables outputs psql variables and options shows command-line options. \? commands is the default output. This help information can also be output via --help=section.

  • Show tablespace size in psql's \db+ (Fabrízio de Royes Mello)

  • Show data type owners in psql's \dT+ (Magnus Hagander)

  • Allow psql's \watch to output \timing information (Fujii Masao)

    Also prevent --echo-hidden from echoing \watch queries.

  • Allow psql's \sf and \ef to honor ECHO_HIDDEN (Andrew Dunstan)

  • Improve psql tab completion for \set, \unset, and :variable names (Pavel Stehule)

  • Allow tab completion of role names in psql \c commands (Ian Barwick)

E.1.3.9.2. pg_dump

  • Allow pg_dump to share a snapshot taken by another session using --snapshot (Simon Riggs, Michael Paquier)

    The remote snapshot must have been exported by pg_export_snapshot() or been defined when creating a logical replication slot. This can be used by parallel pg_dump to use a consistent snapshot across pg_dump processes.

  • Always have pg_dump print server and pg_dump versions (Jing Wang)

    Previously, version information was only printed in --verbose mode.

  • Remove the long-ignored -i/--ignore-version option from pg_dump, pg_dumpall, and pg_restore (Fujii Masao)

E.1.3.9.3. pg_ctl

  • Change pg_ctl's default shutdown mode from smart to fast (Bruce Momjian)

  • Allow multiple pg_ctl -o options to be appended (Bruce Momjian)

  • Allow control of pg_ctl's event source logging on MS Windows (MauMau)

    This only controls pg_ctl, not the server, which has separate settings in postgresql.conf.

E.1.3.9.4. pg_upgrade

  • Move pg_upgrade from contrib to src/bin (Peter Eisentraut)

    In connection with this change, the functionality previously provided by the pg_upgrade_support module has been moved into the core server.

  • Allow multiple pg_upgrade -o/-O options to be appended (Bruce Momjian)

  • Improve database collation comparisons in pg_upgrade (Heikki Linnakangas)

  • Document the use of rsync for standby server upgrades using pg_upgrade (Stephen Frost, Bruce Momjian)

  • Remove support for upgrading from 8.3 clusters (Bruce Momjian)

E.1.3.9.5. pgbench

  • Move pgbench from contrib to src/bin (Peter Eisentraut)

  • Allow counting of pgbench transactions that take over a specified amount of time (Fabien Coelho)

    This is controlled by new --latency-limit option.

  • Allow pgbench to generate Gaussian/exponential distributions using \setrandom (Kondo Mitsumasa, Fabien Coelho)

  • Allow pgbench's \set command to handle multi-operator expressions (Robert Haas, Fabien Coelho)

E.1.3.10. Source Code

  • Simplify WAL record format (Heikki Linnakangas)

    This allows external tools to more easily track what blocks are modified.

  • Add atomic memory operations API (Andres Freund)

  • Allow custom path and scan methods (KaiGai Kohei, Tom Lane)

    This allows extensions greater control over the optimizer and executor.

  • Allow foreign data wrappers to do post-filter locking (Etsuro Fujita)

  • Improve hash_create()'s API for selecting simple-binary-key hash functions (Teodor Sigaev, Tom Lane)

  • Improve parallel execution infrastructure (Robert Haas, Amit Kapila, Noah Misch, Rushabh Lathia, Jeevan Chalke)

  • Remove Alpha (CPU) and Tru64 (OS) ports (Andres Freund)

  • Remove swap-byte-based spinlock implementation for ARMv5 and earlier CPUs (Robert Haas)

    ARMv5's weak memory ordering made this locking implementation unsafe. Spinlock support is still possible on newer gcc implementations with atomics support.

  • Generate an error when excessively long (100+ character) file paths are written to tar files (Peter Eisentraut)

    Tar does not support such overly-long paths.

  • Change index opclass for columns pg_seclabel.provider and pg_shseclabel.provider to be text_pattern_ops (Tom Lane)

    This avoids possible problems with these indexes when different databases of a cluster have different default collations.

  • Change the spinlock primitives to function as compiler barriers (Robert Haas)

E.1.3.10.1. MS Windows

  • Allow higher-precision timestamp resolution on Windows 8 or Windows Server 2012 and later Windows systems (Craig Ringer)

  • Install shared libraries to bin in MS Windows (Peter Eisentraut, Michael Paquier)

  • Install src/test/modules together with contrib on MSVC builds (Michael Paquier)

  • Allow configure's --with-extra-version to be honored by the MSVC build (Michael Paquier)

  • Pass PGFILEDESC into MSVC contrib builds (Michael Paquier)

  • Add icons to all MSVC-built binaries and version information to all MS Windows binaries (Noah Misch)

    MinGW already had such icons.

  • Add optional-argument support to the internal getopt_long() implementation (Michael Paquier, Andres Freund)

    This is used by the MSVC build.

E.1.3.11. Additional Modules

  • Add statistics for minimum, maximum, mean, and standard deviation times to pg_stat_statements (Mitsumasa Kondo, Andrew Dunstan)

  • Add pgcrypto function pgp_armor_headers() to extract PGP armor headers (Marko Tiikkaja, Heikki Linnakangas)

  • Allow empty replacement strings in unaccent (Mohammad Alhashash)

    This is useful in languages where diacritic signs are represented as separate characters.

  • Allow multi-character source strings in unaccent (Tom Lane)

    This could be useful in languages where diacritic signs are represented as separate characters. It also allows more complex unaccent dictionaries.

  • Add contrib modules tsm_system_rows and tsm_system_time to allow additional table sampling methods (Petr Jelínek)

  • Add GIN index inspection functions to pageinspect (Heikki Linnakangas, Peter Geoghegan, Michael Paquier)

  • Add information about buffer pins to pg_buffercache display (Andres Freund)

  • Allow pgstattuple to report approximate answers with less overhead using pgstattuple_approx() (Abhijit Menon-Sen)

  • Move dummy_seclabel, test_shm_mq, test_parser, and worker_spi from contrib to src/test/modules (Álvaro Herrera)

    These modules are only meant for server testing, so they do not need to be built or installed when packaging PostgreSQL.