Release date: 2021-09-30
PostgreSQL 14 contains many new features and enhancements, including:
Stored procedures can now return data via OUT parameters.
The SQL-standard SEARCH and CYCLE options for common table expressions have been implemented.
Subscripting can now be applied to any data type for which it is a useful notation, not only arrays. In this release, the jsonb and hstore types have gained subscripting operators.
Range types have been extended by adding multiranges, allowing representation of noncontiguous data ranges.
Numerous performance improvements have been made for parallel queries, heavily-concurrent workloads, partitioned tables, logical replication, and vacuuming.
B-tree index updates are managed more efficiently, reducing index bloat.
VACUUM automatically becomes more aggressive, and skips inessential cleanup, if the database starts to approach a transaction ID wraparound condition.
Extended statistics can now be collected on expressions, allowing better planning results for complex queries.
libpq now has the ability to pipeline multiple queries, which can boost throughput over high-latency connections.
The above items and other new features of PostgreSQL 14 are explained in more detail in the sections below.
A dump/restore using pg_dumpall or use of pg_upgrade or logical replication is required for those wishing to migrate data from any previous release. See Section 19.6 for general information on migrating to new major releases.
Version 14 contains a number of changes that may affect compatibility with previous releases. Observe the following incompatibilities:
User-defined objects that reference certain built-in array functions along with their argument types must be recreated (Tom Lane) ยง
Specifically, array_append(), array_prepend(), array_cat(), array_position(), array_positions(), array_remove(), array_replace(), and width_bucket() used to take anyarray arguments but now take anycompatiblearray. Therefore, user-defined objects like aggregates and operators that reference those array function signatures must be dropped before upgrading, and recreated once the upgrade completes.
Remove deprecated containment operators @ and ~ for built-in geometric data types and contrib modules cube, hstore, intarray, and seg (Justin Pryzby) ยง ยง
The more consistently named <@ and @> have been recommended for many years.
Fix to_tsquery() and websearch_to_tsquery() to properly parse query text containing discarded tokens (Alexander Korotkov) ยง
Certain discarded tokens, like underscore, caused the output of these functions to produce incorrect tsquery output, e.g., both websearch_to_tsquery('"pg_class pg"') and to_tsquery('pg_class <-> pg') used to output ( 'pg' & 'class' ) <-> 'pg', but now both output 'pg' <-> 'class' <-> 'pg'.
Fix websearch_to_tsquery() to properly parse multiple adjacent discarded tokens in quotes (Alexander Korotkov) ยง
Previously, quoted text that contained multiple adjacent discarded tokens was treated as multiple tokens, causing incorrect tsquery output, e.g., websearch_to_tsquery('"aaa: bbb"') used to output 'aaa' <2> 'bbb', but now outputs 'aaa' <-> 'bbb'.
Change EXTRACT() to return type numeric instead of float8 (Peter Eisentraut) ยง
This avoids loss-of-precision issues in some usages. The old behavior can still be obtained by using the old underlying function date_part().
Also, EXTRACT(date) now throws an error for units that are not part of the date data type.
Change var_samp() and stddev_samp() with numeric parameters to return NULL when the input is a single NaN value (Tom Lane) ยง
Previously NaN was returned.
Return false for has_column_privilege() checks on non-existent or dropped columns when using attribute numbers (Joe Conway) ยง
Previously such attribute numbers returned an invalid-column error.
Fix handling of infinite window function ranges (Tom Lane) ยง
Previously window frame clauses like 'inf' PRECEDING AND 'inf' FOLLOWING returned incorrect results.
Remove factorial operators ! and !!, as well as function numeric_fac() (Mark Dilger) ยง
The factorial() function is still supported.
Disallow factorial() of negative numbers (Peter Eisentraut) ยง
Previously such cases returned 1.
Remove support for postfix (right-unary) operators (Mark Dilger) ยง
pg_dump and pg_upgrade will warn if postfix operators are being dumped.
Allow \D and \W shorthands to match newlines in regular expression newline-sensitive mode (Tom Lane) ยง
Previously they did not match newlines in this mode, but that disagrees with the behavior of other common regular expression engines. [^[:digit:]] or [^[:word:]] can be used to get the old behavior.
Disregard constraints when matching regular expression back-references (Tom Lane) ยง
For example, in (^\d+).*\1, the ^ constraint should be applied at the start of the string, but not when matching \1.
Disallow \w as a range start or end in regular expression character classes (Tom Lane) ยง
This previously was allowed but produced unexpected results.
Require custom server parameter names to use only characters that are valid in unquoted SQL identifiers (Tom Lane) ยง ยง
Change the default of the password_encryption server parameter to scram-sha-256 (Peter Eisentraut) ยง
Previously it was md5. All new passwords will be stored as SHA256 unless this server setting is changed or the password is specified in MD5 format. Also, the legacy (and undocumented) Boolean-like values which were previously synonyms for md5 are no longer accepted.
Remove server parameter vacuum_cleanup_index_scale_factor (Peter Geoghegan) ยง ยง
This setting was ignored starting in PostgreSQL version 13.3.
Remove server parameter operator_precedence_warning (Tom Lane) ยง
This setting was used for warning applications about PostgreSQL 9.5 changes.
Overhaul the specification of clientcert in pg_hba.conf (Kyotaro Horiguchi) ยง
Values 1/0/no-verify are no longer supported; only the strings verify-ca and verify-full can be used. Also, disallow verify-ca if cert authentication is enabled since cert requires verify-full checking.
Remove support for SSL compression (Daniel Gustafsson, Michael Paquier) ยง ยง
This was already disabled by default in previous PostgreSQL releases, and most modern OpenSSL and TLS versions no longer support it.
Remove server and libpq support for the version 2 wire protocol (Heikki Linnakangas) ยง
This was last used as the default in PostgreSQL 7.3 (released in 2002).
Disallow single-quoting of the language name in the CREATE/DROP LANGUAGE command (Peter Eisentraut) ยง
Remove the composite types that were formerly created for sequences and toast tables (Tom Lane) ยง
Process doubled quote marks in ecpg SQL command strings correctly (Tom Lane) ยง ยง
Previously 'abc''def' was passed to the server as 'abc'def', and "abc""def" was passed as "abc"def", causing syntax errors.
Prevent the containment operators (<@ and @>) for intarray from using GiST indexes (Tom Lane) ยง
Previously a full GiST index scan was required, so just avoid that and scan the heap, which is faster. Indexes created for this purpose should be removed.
Remove contrib program pg_standby (Justin Pryzby) ยง
Prevent tablefunc's function normal_rand() from accepting negative values (Ashutosh Bapat) ยง
Negative values produced undesirable results.
Below you will find a detailed account of the changes between PostgreSQL 14 and the previous major release.
Add predefined roles pg_read_all_data and pg_write_all_data (Stephen Frost) ยง
These non-login roles can be used to give read or write permission to all tables, views, and sequences.
Add predefined role pg_database_owner that contains only the current database's owner (Noah Misch) ยง
This is especially useful in template databases.
Remove temporary files after backend crashes (Euler Taveira) ยง
Previously, such files were retained for debugging purposes. If necessary, deletion can be disabled with the new server parameter remove_temp_files_after_crash.
Allow long-running queries to be canceled if the client disconnects (Sergey Cherkashin, Thomas Munro) ยง
The server parameter client_connection_check_interval allows control over whether loss of connection is checked for intra-query. (This is supported on Linux and a few other operating systems.)
Add an optional timeout parameter to pg_terminate_backend() (Magnus Hagander) ยง
Allow wide tuples to be always added to almost-empty heap pages (John Naylor, Floris van Nee) ยง
Previously tuples whose insertion would have exceeded the page's fill factor were instead added to new pages.
Add Server Name Indication (SNI) in SSL connection packets (Peter Eisentraut) ยง
This can be disabled by turning off client connection option sslsni.
Allow vacuum to skip index vacuuming when the number of removable index entries is insignificant (Masahiko Sawada, Peter Geoghegan) ยง ยง
The vacuum parameter INDEX_CLEANUP has a new default of auto that enables this optimization.
Allow vacuum to more eagerly add deleted btree pages to the free space map (Peter Geoghegan) ยง
Previously vacuum could only add pages to the free space map that were marked as deleted by previous vacuums.
Allow vacuum to reclaim space used by unused trailing heap line pointers (Matthias van de Meent, Peter Geoghegan) ยง
Allow vacuum to be more aggressive in removing dead rows during minimal-locking index operations (รlvaro Herrera) ยง ยง ยง
Specifically, CREATE INDEX CONCURRENTLY and REINDEX CONCURRENTLY no longer limit the dead row removal of other relations.
Speed up vacuuming of databases with many relations (Tatsuhito Kasahara) ยง
Reduce the default value of vacuum_cost_page_miss to better reflect current hardware capabilities (Peter Geoghegan) ยง
Add ability to skip vacuuming of TOAST tables (Nathan Bossart) ยง
VACUUM now has a PROCESS_TOAST option which can be set to false to disable TOAST processing, and vacuumdb has a --no-process-toast option.
Have COPY FREEZE appropriately update page visibility bits (Anastasia Lubennikova, Pavan Deolasee, Jeff Janes) ยง
Cause vacuum operations to be more aggressive if the table is near xid or multixact wraparound (Masahiko Sawada, Peter Geoghegan) ยง
This is controlled by vacuum_failsafe_age and vacuum_multixact_failsafe_age.
Increase warning time and hard limit before transaction id and multi-transaction wraparound (Noah Misch) ยง
This should reduce the possibility of failures that occur without having issued warnings about wraparound.
Add per-index information to autovacuum logging output (Masahiko Sawada) ยง
Improve the performance of updates and deletes on partitioned tables with many partitions (Amit Langote, Tom Lane) ยง ยง ยง
This change greatly reduces the planner's overhead for such cases, and also allows updates/deletes on partitioned tables to use execution-time partition pruning.
Allow partitions to be detached in a non-blocking manner (รlvaro Herrera) ยง
The syntax is ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY, and FINALIZE.
Ignore COLLATE clauses in partition boundary values (Tom Lane) ยง
Previously any such clause had to match the collation of the partition key; but it's more consistent to consider that it's automatically coerced to the collation of the partition key.
Allow btree index additions to remove expired index entries to prevent page splits (Peter Geoghegan) ยง ยง
This is particularly helpful for reducing index bloat on tables whose indexed columns are frequently updated.
Allow BRIN indexes to record multiple min/max values per range (Tomas Vondra) ยง
This is useful if there are groups of values in each page range.
Allow BRIN indexes to use bloom filters (Tomas Vondra) ยง
This allows BRIN indexes to be used effectively with data that is not well-localized in the heap.
Allow some GiST indexes to be built by presorting the data (Andrey Borodin) ยง
Presorting happens automatically and allows for faster index creation and smaller indexes.
Allow SP-GiST indexes to contain INCLUDE'd columns (Pavel Borisov) ยง
Allow hash lookup for IN clauses with many constants (James Coleman, David Rowley) ยง
Previously the code always sequentially scanned the list of values.
Increase the number of places extended statistics can be used for OR clause estimation (Tomas Vondra, Dean Rasheed) ยง ยง ยง
Allow extended statistics on expressions (Tomas Vondra) ยง
This allows statistics on a group of expressions and columns, rather than only columns like previously. System view pg_stats_ext_exprs reports such statistics.
Allow efficient heap scanning of a range of TIDs (Edmund Horner, David Rowley) ยง
Previously a sequential scan was required for non-equality TID specifications.
Fix EXPLAIN CREATE TABLE AS and EXPLAIN CREATE MATERIALIZED VIEW to honor IF NOT EXISTS (Bharath Rupireddy) ยง
Previously, if the object already existed, EXPLAIN would fail.
Improve the speed of computing MVCC visibility snapshots on systems with many CPUs and high session counts (Andres Freund) ยง ยง ยง ยง ยง ยง
This also improves performance when there are many idle sessions.
Add executor method to memoize results from the inner side of a nested-loop join (David Rowley) ยง
This is useful if only a small percentage of rows is checked on the inner side. It can be disabled via server parameter enable_memoize.
Allow window functions to perform incremental sorts (David Rowley) ยง
Improve the I/O performance of parallel sequential scans (Thomas Munro, David Rowley) ยง
This was done by allocating blocks in groups to parallel workers.
Allow a query referencing multiple foreign tables to perform foreign table scans in parallel (Robert Haas, Kyotaro Horiguchi, Thomas Munro, Etsuro Fujita) ยง
postgres_fdw supports this type of scan if async_capable is set.
Allow analyze to do page prefetching (Stephen Frost) ยง
This is controlled by maintenance_io_concurrency.
Improve performance of regular expression searches (Tom Lane) ยง ยง ยง ยง ยง ยง ยง ยง ยง ยง ยง
Dramatically improve Unicode normalization performance (John Naylor) ยง ยง
This speeds normalize() and IS NORMALIZED.
Add ability to use LZ4 compression on TOAST data (Dilip Kumar) ยง
This can be set at the column level, or set as a default via server parameter default_toast_compression. The server must be compiled with --with-lz4 to support this feature. The default setting is still pglz.
If server parameter compute_query_id is enabled, display the query id in pg_stat_activity,