Release 12.4Release date:2020-08-13
This release contains a variety of fixes from 12.3.
For information about new features in major release 12, see
.
Migration to Version 12.4
A dump/restore is not required for those running 12.X.
However, if you are upgrading from a version earlier than 12.2,
see .
Changes
Set a secure search_path in logical replication
walsenders and apply workers (Noah Misch)
A malicious user of either the publisher or subscriber database
could potentially cause execution of arbitrary SQL code by the role
running replication, which is often a superuser. Some of the risks
here are equivalent to those described in CVE-2018-1058, and are
mitigated in this patch by ensuring that the replication sender and
receiver execute with empty search_path settings.
(As with CVE-2018-1058, that change might cause problems for
under-qualified names used in replicated tables' DDL.) Other risks
are inherent in replicating objects that belong to untrusted roles;
the most we can do is document that there is a hazard to consider.
(CVE-2020-14349)
Make contrib modules' installation scripts more secure (Tom Lane)
Attacks similar to those described in CVE-2018-1058 could be carried
out against an extension installation script, if the attacker can
create objects in either the extension's target schema or the schema
of some prerequisite extension. Since extensions often require
superuser privilege to install, this can open a path to obtaining
superuser privilege. To mitigate this risk, be more careful about
the search_path used to run an installation
script; disable check_function_bodies within the
script; and fix catalog-adjustment queries used in some contrib
modules to ensure they are secure. Also provide documentation to
help third-party extension authors make their installation scripts
secure. This is not a complete solution; extensions that depend on
other extensions can still be at risk if installed carelessly.
(CVE-2020-14350)
Fix edge cases in partition pruning (Etsuro Fujita, Dmitry Dolgov)
When there are multiple partition key columns, generation of pruning
tests could misbehave if some columns had no
constraining WHERE clauses or multiple
constraining clauses. This could lead to server crashes, incorrect
query results, or assertion failures.
Fix construction of parameterized BitmapAnd and BitmapOr index scans
on the inside of partition-wise nestloop joins (Tom Lane)
A plan in which such a scan needed to use a value from the outside
of the join would usually crash at execution.
Fix incorrect plan execution when a partitioned table is subject to
both static and run-time partition pruning in the same query, and a
new partition is added concurrently with the query (Amit Langote,
Tom Lane)
In logical replication walsender, fix failure to send feedback
messages after sending a keepalive message (Álvaro Herrera)
This is a relatively minor problem when using built-in logical
replication, because the built-in walreceiver will send a feedback
reply (which clears the incorrect state) fairly frequently anyway.
But with some other replication systems, such
as pglogical, it causes significant
performance issues.
Fix firing of column-specific UPDATE triggers in
logical replication subscribers (Tom Lane)
The code neglected to account for the possibility of column numbers
being different between the publisher and subscriber tables, so that
if those were indeed different, wrong decisions might be made about
which triggers to fire.
Update oldest xmin and LSN values
during pg_replication_slot_advance() (Michael
Paquier)
This function previously failed to do that, possibly preventing
resource cleanup (such as removal of no-longer-needed WAL segments)
after manual advancement of a replication slot.
Fix slow execution of ts_headline() (Tom Lane)
The phrase-search fix added in our previous set of minor releases
could cause ts_headline() to take unreasonable
amounts of time for long documents; to make matters worse, the query
was not cancellable within the troublesome loop.
Ensure the repeat() function can be interrupted
by query cancel (Joe Conway)
Fix pg_current_logfile() to not include a
carriage return (\r) in its result on Windows
(Tom Lane)
Ensure that pg_read_file() and related
functions read until EOF is reached (Joe Conway)
Previously, if not given a specific data length to read, these
functions would stop at whatever file length was reported
by stat(). That's unhelpful for pipes and
other sorts of virtual files.
Forbid numeric NaN values in jsonpath
computations (Alexander Korotkov)
Neither SQL nor JSON have the concept of NaN
(not-a-number), but the jsonpath code attempted to
allow such values anyway. This necessarily leads to nonstandard
behavior, so it seems better to reject such values at the outset.
Handle single Inf or NaN
inputs correctly in floating-point aggregates (Tom Lane)
The affected aggregates are
corr(),
covar_pop(),
regr_intercept(),
regr_r2(),
regr_slope(),
regr_sxx(),
regr_sxy(),
regr_syy(),
stddev_pop(), and
var_pop().
The correct answer in such cases is NaN, but an
algorithmic change introduced in PostgreSQL
v12 had caused these aggregates to produce zero instead.
Fix mis-handling of NaN inputs during parallel
aggregation on numeric-type columns (Tom Lane)
If some partial aggregation workers found only NaNs
while others found only non-NaNs, the results
were combined incorrectly, possibly leading to the wrong overall
result (i.e., not NaN when it should be).
Reject time-of-day values greater than 24 hours (Tom Lane)
The intention of the datetime input code is to
allow 24:00:00 or
equivalently 23:59:60, but no larger value.
However, the range check was miscoded so that it would
accept 23:59:60.nnn with
nonzero fractional-second nnn. In
timestamp values this would result in wrapping into the first second
of the next day. In time and timetz
values, the stored value would actually be more than 24 hours,
causing dump/reload failures and possibly other misbehavior.
Undo double-quoting of index names in EXPLAIN's
non-text output formats (Tom Lane, Euler Taveira)
Fix EXPLAIN's accounting for resource usage,
particularly buffer accesses, in parallel workers in a plan
using Gather Merge nodes
(Jehan-Guillaume de Rorthais)
Fix timing of constraint revalidation in ALTER
TABLE (David Rowley)
If ALTER TABLE needs to fully rewrite the table's
contents (for example, due to change of a column's data type) and
also needs to scan the table to re-validate foreign keys
or CHECK constraints, it sometimes did things in
the wrong order, leading to odd errors such as could not read
block 0 in file "base/nnnnn/nnnnn": read only 0 of 8192 bytes.
Fix REINDEX CONCURRENTLY to preserve the index's
replication identity flag (Michael Paquier)
Previously, reindexing a table's replica identity index caused the
setting to be lost, preventing old tuple values from being included
in future logical-decoding output.
Work around incorrect not-null markings for
pg_subscription.subslotname
and pg_subscription_rel.srsublsn
(Tom Lane)
The bootstrap catalog data incorrectly marks these two catalog
columns as always non-null. There's no easy way to correct that
mistake in existing installations (though v13 and later will have
the correct markings). The main place that depends on that marking
being correct is JIT-enabled tuple deconstruction, so teach it to
explicitly ignore the marking for these two columns. Also adjust
some C code that accessed srsublsn without
checking to see if it's null; a crash from that is improbable but
perhaps not impossible.
Cope with LATERAL references in restriction
clauses attached to an un-flattened sub-SELECT in
the FROM clause (Tom Lane)
This oversight could result in assertion failures or crashes at
query execution.
Use the query-specified collation for operators invoked during
selectivity estimation (Tom Lane)
Previously, the collation of the underlying database column was
used. But using the query's collation is arguably more correct.
More importantly, now that we have nondeterministic collations,
there are cases where an operator will fail outright if given a
nondeterministic collation. We don't want planning to fail in cases
where the query itself would work, so this means that we must use
the query's collation when invoking operators for estimation
purposes.
Avoid believing that a never-analyzed foreign table has zero tuples
(Tom Lane)
This primarily affected the planner's estimate of the number of
groups that would be obtained by GROUP BY.
Remove bogus warning about leftover placeholder tuple
in BRIN index de-summarization (Álvaro Herrera)
The case can occur legitimately after a cancelled vacuum, so warning
about it is overly noisy.
Fix selection of tablespaces for shared fileset
temporary files (Magnus Hagander, Tom Lane)
If temp_tablespaces is empty or explicitly names
the database's primary tablespace, such files got placed into
the pg_default tablespace rather than the
database's primary tablespace as expected.
Fix corner-case error in masking of SP-GiST index pages during WAL
consistency checking (Alexander Korotkov)
This could cause false failure reports
when wal_consistency_checking is enabled.
Improve error handling in the server's buffile
module (Thomas Munro)
Fix some cases where I/O errors were indistinguishable from reaching
EOF, or were not reported at all. Also add details such as block
numbers and byte counts where appropriate.
Fix conflict-checking anomalies in SERIALIZABLE
isolation mode (Peter Geoghegan)
If a concurrently-inserted tuple was updated by a different
concurrent transaction, and neither tuple version was visible to the
current transaction's snapshot, serialization conflict checking
could draw the wrong conclusions about whether the tuple was relevant
to the results of the current transaction. This could allow a
serializable transaction to commit when it should have failed with a
serialization error.
Avoid repeated marking of dead btree index entries as dead (Masahiko
Sawada)
While functionally harmless, this led to useless WAL traffic when
checksums are enabled or wal_log_hints is on.
Fix checkpointer process to discard file sync requests
when fsync is off (Heikki Linnakangas)
Such requests are treated as no-ops if fsync is
off, but we forgot to remove them from the checkpointer's table of
pending actions. This would lead to bloat of that table, as well as
possible assertion failures if fsync is later
re-enabled.
Avoid trouble during cleanup of a non-exclusive backup when JIT
compilation has been activated during the backup (Robert Haas)
Fix failure of some code paths to acquire the correct lock before
modifying pg_control (Nathan Bossart, Fujii
Masao)
This oversight could allow pg_control to be
written out with an inconsistent checksum, possibly causing trouble
later, including inability to restart the database if it crashed
before the next pg_control update.
Fix errors in currtid()
and currtid2() (Michael Paquier)
These functions (which are undocumented and used only by ancient
versions of the ODBC driver) contained coding errors that could
result in crashes, or in confusing error messages such as could
not open file when applied to a relation having no storage.
Avoid calling elog()
or palloc() while holding a spinlock (Michael
Paquier, Tom Lane)
Logic associated with replication slots had several violations of
this coding rule. While the odds of trouble are quite low, an error
in the called function would lead to a stuck spinlock.
Fix assertion in logical replication subscriber to allow use
of REPLICA IDENTITY FULL (Euler Taveira)
This was just an incorrect assertion, so it has no impact on
standard production builds.
Ensure that libpq continues to try to
read from the database connection socket after a write failure
(Tom Lane)
This is important not only to ensure that we collect any final error
message from a dying server process, but because we do not consider
the connection lost until we see a read failure. This oversight
allowed libpq to continue trying to
send COPY data indefinitely after a mid-transfer
loss of connection, rather than reporting failure to the application.
Fix bugs in libpq's management of GSS
encryption state (Tom Lane)
A connection using GSS encryption could freeze up when attempting to
reset it after a server restart, or when moving on to the next one of
a list of candidate servers.
Fix ecpg crash with bytea
and cursor variables (Jehan-Guillaume de Rorthais)
Report out-of-disk-space errors properly
in pg_dump
and pg_basebackup (Justin Pryzby, Tom
Lane, Álvaro Herrera)
Some code paths could produce silly reports like could not
write file: Success.
Make pg_restore cope with
data-offset-less custom-format archive files when it needs to
restore data items out of order (David Gilman, Tom Lane)
pg_dump will produce such files if it
cannot seek its output (for example, if the output is piped to
something). This fix primarily improves the ability to do a
parallel restore from such a file.
Fix parallel restore of tables having both table-level privileges
and per-column privileges (Tom Lane)
The table-level privilege grants have to be applied first, but a
parallel restore did not reliably order them that way; this could
lead to tuple concurrently updated errors, or to
disappearance of some per-column privilege grants. The fix for this
is to include dependency links between such entries in the archive
file, meaning that a new dump has to be taken with a
corrected pg_dump to ensure that the
problem will not recur.
Ensure that pg_upgrade runs
with vacuum_defer_cleanup_age set to zero in the
target cluster (Bruce Momjian)
If the target cluster's configuration has been modified to
set vacuum_defer_cleanup_age to a nonzero value,
that prevented freezing of the system catalogs from working properly,
which caused the upgrade to fail in confusing ways. Ensure that any
such setting is overridden for the duration of the upgrade.
Fix pg_recvlogical to drain pending
messages before exiting (Noah Misch)
Without this, the replication sender might detect a send failure and
exit without making the expected final update to the replication
slot's LSN position. That led to re-transmitting data after the
next connection. It was also possible to miss error messages sent
after the last data that pg_recvlogical
wants to consume.
Fix pg_rewind's handling of just-deleted
files in the source data directory (Justin Pryzby, Michael Paquier)
When working with an on-line source database, concurrent file
deletions are possible, but pg_rewind
would get confused if deletion happened between seeing a file's
directory entry and examining it with stat().
Make pg_test_fsync use binary I/O mode on
Windows (Michael Paquier)
Previously it wrote the test file in text mode, which is not an
accurate reflection of PostgreSQL's
actual usage.
Fix contrib/amcheck to not complain about
deleted index pages that are empty (Alexander Korotkov)
This state of affairs is normal during WAL replay.
Fix failure to initialize local state correctly
in contrib/dblink (Joe Conway)
With the right combination of circumstances, this could lead to
dblink_close() issuing an unexpected
remote COMMIT.
Fix contrib/pgcrypto's misuse
of deflate() (Tom Lane)
The pgp_sym_encrypt functions could produce
incorrect compressed data due to mishandling
of zlib's API requirements. We have no
reports of this error manifesting with
stock zlib, but it can be seen when using
IBM's zlibNX implementation.
Fix corner case in decompression logic
in contrib/pgcrypto's
pgp_sym_decrypt functions (Kyotaro Horiguchi,
Michael Paquier)
A compressed stream can validly end with an empty packet, but the
decompressor failed to handle this and would complain about corrupt
data.
Support building our NLS code with Microsoft Visual Studio 2015 or
later (Juan José Santamaría Flecha, Davinder Singh,
Amit Kapila)
Avoid possible failure of our MSVC install script when there is a
file named configure several levels above the
source code tree (Arnold Müller)
This could confuse some logic that looked
for configure to identify the top level of the
source tree.
Release 12.3Release date:2020-05-14
This release contains a variety of fixes from 12.2.
For information about new features in major release 12, see
.
Migration to Version 12.3
A dump/restore is not required for those running 12.X.
However, if you are upgrading from a version earlier than 12.2,
see .
Changes
Fix possible failure with GENERATED columns
(David Rowley)
If a GENERATED column's value is an exact copy of
another column of the table (and it is a pass-by-reference data
type), it was possible to crash or insert corrupted data into the
table. While it would be rather pointless for
a GENERATED expression to just duplicate another
column, an expression using a function that sometimes returns its
input unchanged could create the situation.
Handle inheritance of generated columns better (Peter Eisentraut)
When a table column is inherited during CREATE TABLE
... INHERITS, disallow changing any generation properties
when the parent column is already
marked GENERATED; but allow a child column to be
marked GENERATED when its parent is not.
Fix cross-column references in CREATE TABLE LIKE INCLUDING
GENERATED (Peter Eisentraut)
CREATE TABLE ... LIKE failed when trying to copy
a GENERATED expression that references a
physically-later column.
Propagate ALTER TABLE ... SET STORAGE to indexes
(Peter Eisentraut)
Non-expression index columns have always copied
the attstorage property of their table
column at creation. Update them when ALTER TABLE ... SET
STORAGE is done, to maintain consistency.
Preserve the indisclustered setting of
indexes rewritten by ALTER TABLE (Amit Langote,
Justin Pryzby)
Previously, ALTER TABLE lost track of which index
had been used for CLUSTER.
Preserve the replica identity properties of indexes rewritten
by ALTER TABLE (Quan Zongliang, Peter Eisentraut)
Preserve the indisclustered setting of
indexes rebuilt by REINDEX CONCURRENTLY
(Justin Pryzby)
Lock objects sooner during DROP OWNED BY
(Álvaro Herrera)
This avoids failures in race-condition cases where another session is
deleting some of the same objects.
Fix error-case processing for CREATE ROLE ... IN
ROLE (Andrew Gierth)
Some error cases would be reported as unexpected node
type or the like, instead of the intended message.
Ensure that when a partition is detached, any triggers cloned from
its formerly-parent table are removed (Justin Pryzby)
Fix crash when COLLATE is applied to a
non-collatable type in a partition bound expression (Dmitry Dolgov)
Ensure that unique indexes over partitioned tables match the
equality semantics of the partitioning key (Guancheng Luo)
This would only be an issue with index opclasses that have unusual
notions of equality, but it's wrong in theory, so check.
Ensure that members of the pg_read_all_stats role
can read all statistics views, as expected (Magnus Hagander)
The functions underlying
the pg_stat_progress_* views had not gotten
this memo.
Repair performance regression in
information_schema.triggers
view (Tom Lane)
This patch redefines that view so that an
outer WHERE clause constraining the table name
can be pushed down into the view, allowing its calculations to be
done only for triggers belonging to the table of interest rather
than all triggers in the database. In a database with many triggers
this would make a significant speed difference for queries of that
form. Since things worked that way before v11, this is a potential
performance regression. Users who find this to be a problem can fix
it by replacing the view definition (or, perhaps, just deleting and
reinstalling the whole information_schema
schema).
Repair performance regression in floating point overflow/underflow
detection (Emre Hasegeli)
Previous refactoring had resulted in isinf()
being called extra times in some hot code paths.
Fix full text search to handle NOT above a phrase search correctly
(Tom Lane)
Queries such as !(foo<->bar) failed to find
matching rows when implemented as a GiST or GIN index search.
Fix full text search for cases where a phrase search includes an
item with both prefix matching and a weight restriction (Tom Lane)
Fix ts_headline() to make better headline
selections when working with phrase queries (Tom Lane)
Fix bugs in gin_fuzzy_search_limit processing
(Adé Heyward, Tom Lane)
A small value of gin_fuzzy_search_limit could
result in unexpected slowness due to unintentionally rescanning the
same index page many times. Another code path failed to apply the
intended filtering at all, possibly returning too many values.
Allow input of type circle to accept the format
(x,y),r
as the documentation says it does (David Zhang)
Make the get_bit()
and set_bit() functions cope
with bytea strings longer than 256MB (Movead Li)
Since the bit number argument is only int4, it's
impossible to use these functions to access bits beyond the first
256MB of a long bytea. We'll widen the argument
to int8 in v13, but in the meantime, allow these
functions to work on the initial substring of a
long bytea.
Ignore file-not-found errors in pg_ls_waldir()
and allied functions (Tom Lane)
This prevents a race condition failure if a file is removed between
when we see its directory entry and when we attempt
to stat() it.
Avoid possibly leaking an open-file descriptor for a directory
in pg_ls_dir(),
pg_timezone_names(),
pg_tablespace_databases(), and allied functions
(Justin Pryzby)
Fix polymorphic-function type resolution to correctly infer the
actual type of an anyarray output when given only
an anyrange input (Tom Lane)
Fix server's connection-startup logic for case where a GSSAPI
connection is rejected because support is not compiled in, and the
client then tries SSL instead (Andrew Gierth)
This led to a bogus unsupported frontend protocol
failure.
Fix memory leakage during GSSAPI encryption (Tom Lane)
Both the backend and libpq would leak memory equivalent to the total
amount of data sent during the session, if GSSAPI encryption is in use.
Fix query-lifespan memory leak for a set-returning function used in
a query's FROM clause (Andres Freund)
Avoid leakage of a hashed subplan's hash tables across multiple
executions (Andreas Karlsson, Tom Lane)
This mistake could result in severe memory bloat if a query
re-executed a hashed subplan enough times.
Improve planner's handling of no-op domain coercions (Tom Lane)
Fix some cases where a domain coercion that does nothing was not
completely removed from expressions.
Avoid unlikely crash when REINDEX is terminated
by a session-shutdown signal (Tom Lane)
Prevent printout of possibly-incorrect hash join table statistics
in EXPLAIN (Konstantin Knizhnik, Tom Lane, Thomas
Munro)
Fix reporting of elapsed time for heap truncation steps
in VACUUM VERBOSE (Tatsuhito Kasahara)
Fix possible undercounting of deleted B-tree index pages
in VACUUM VERBOSE output (Peter Geoghegan)
Fix wrong bookkeeping for oldest deleted page in a B-tree index
(Peter Geoghegan)
This could cause subtly wrong decisions about
when VACUUM can skip an index cleanup scan;
although it appears there may be no significant user-visible effects
from that.
Ensure that TimelineHistoryRead and TimelineHistoryWrite wait states
are reported in all code paths that read or write timeline history
files (Masahiro Ikeda)
Avoid possibly showing waiting twice in a process's
PS status (Masahiko Sawada)
Avoid race condition when ANALYZE replaces the
catalog tuple for extended statistics data (Dean Rasheed)
Remove ill-considered skip of redundant
anti-wraparound vacuums (Michael Paquier)
This avoids a corner case where autovacuum could get into a loop of
repeatedly trying and then skipping the same vacuum job.
Ensure INCLUDE'd columns are always removed from B-tree pivot tuples
(Peter Geoghegan)
This mistake wasted space in some rare cases, but was otherwise
harmless.
Cope with invalid TOAST indexes that could be left over after a
failed REINDEX CONCURRENTLY (Julien Rouhaud)
Ensure that valid index dependencies are left behind after a
failed REINDEX CONCURRENTLY (Michael Paquier)
Previously the old index could be left with
no pg_depend links at all, so that for
example it would not get dropped if the parent table is dropped.
Avoid failure if autovacuum tries to access a just-dropped temporary
schema (Tom Lane)
This hazard only arises if a superuser manually drops a temporary
schema; which isn't normal practice, but should work.
Avoid premature recycling of WAL segments during crash recovery
(Jehan-Guillaume de Rorthais)
WAL segments that become ready to be archived during crash recovery
were potentially recycled without being archived.
Avoid scanning irrelevant timelines during archive recovery (Kyotaro
Horiguchi)
This can eliminate many attempts to fetch non-existent WAL files from
archive storage, which is helpful if archive access is slow.
Remove bogus subtransaction logged without previous top-level
txn record error check in logical decoding (Arseny Sher,
Amit Kapila)
This condition is legitimately reachable in various scenarios, so
remove the check.
Avoid possible failure after a replication slot copy, due to
premature removal of WAL data (Masahiko Sawada, Arseny Sher)
Ensure that a replication
slot's io_in_progress_lock is released in failure
code paths (Pavan Deolasee)
This could result in a walsender later becoming stuck waiting for
the lock.
Ensure that generated columns are correctly handled during updates
issued by logical replication (Peter Eisentraut)
Fix race conditions in synchronous standby management (Tom Lane)
During a change in the synchronous_standby_names
setting, there was a window in which wrong decisions could be made
about whether it is OK to release transactions that are waiting for
synchronous commit. Another hazard for similarly wrong decisions
existed if a walsender process exited and was immediately replaced
by another.
Add missing SQLSTATE values to a few error reports (Sawada Masahiko)
Fix PL/pgSQL to reliably refuse to execute an event trigger function
as a plain function (Tom Lane)
Fix memory leak in libpq when
using sslmode=verify-full (Roman Peshkurov)
Certificate verification during connection startup could leak some
memory. This would become an issue if a client process opened many
database connections during its lifetime.
Fix ecpg to treat an argument of
just - as meaning read
from stdin on all platforms (Tom Lane)
Fix crash in psql when attempting to
re-establish a failed connection (Michael Paquier)
Allow tab-completion of the filename argument
to psql's \gx command
(Vik Fearing)
Add pg_dump support for ALTER
... DEPENDS ON EXTENSION (Álvaro Herrera)
pg_dump previously ignored dependencies added
this way, causing them to be forgotten during dump/restore or
pg_upgrade.
Fix pg_dump to dump comments on RLS
policy objects (Tom Lane)
In pg_dump, postpone restore of event
triggers till the end (Fabrízio de Royes Mello, Hamid Akhtar,
Tom Lane)
This minimizes the risk that an event trigger could interfere with
the restoration of other objects.
Ensure that pg_basebackup generates valid
tar files (Robert Haas)
In some cases a partial block of zeroes would be added to the end of
the file. While this seems to be harmless with common versions of
tar, it's not OK per the POSIX file format spec.
Make pg_checksums skip tablespace
subdirectories that belong to a
different PostgreSQL major version
(Michael Banck, Bernd Helmle)
Such subdirectories don't really belong to our database cluster, and
so must not be processed.
Ignore temporary copies of pg_internal.init
in pg_checksums and related
programs (Michael Paquier)
Fix quoting of ,
and values
in createdb utility (Michael Paquier)
contrib/lo's lo_manage()
function crashed if called directly rather than as a trigger (Tom
Lane)
In contrib/ltree,
protect against overflow of ltree
and lquery length fields (Nikita Glukhov)
Work around failure in contrib/pageinspect's
bt_metap() function when an oldest_xact value
exceeds 2^31-1 (Peter Geoghegan)
Such XIDs will now be reported as negative integers, which isn't
great but it beats throwing an error. v13 will widen the output
argument to int8 to provide saner reporting.
Fix cache reference leak in contrib/sepgsql
(Michael Luo)
On Windows, avoid premature creation of postmaster's log file
during pg_ctl start (Alexander Lakhin)
The previous coding could allow the file to be created with
permissions that wouldn't allow the postmaster to write on it.
Avoid failures when dealing with Unix-style locale names on
Windows (Juan José Santamaría Flecha)
On Windows, set console VT100 compatibility mode in
programs that support PG_COLOR colorization
(Juan José Santamaría Flecha)
Without this, the colorization option doesn't actually work.
Stop requiring extra parentheses in ereport()
calls (Andres Freund, Tom Lane)
Use pkg-config, if available, to
locate libxml2
during configure (Hugh McMaster, Tom
Lane, Peter Eisentraut)
If pkg-config is not present or lacks
knowledge of libxml2, we still
query xml2-config as before.
This change could break build processes that try to
make PostgreSQL use a non-default version
of libxml2 by putting that
version's xml2-config into
the PATH. Instead,
set XML2_CONFIG to point to the
non-default xml2-config. That method
will work with either older or
newer PostgreSQL releases.
Fix Makefile dependencies for libpq
and ecpg (Dagfinn Ilmari Mannsåker)
In MSVC builds, cope with spaces in the path name for Python
(Victor Wagner)
In MSVC builds, fix detection of Visual Studio version to work with
more language settings (Andrew Dunstan)
In MSVC builds, use -Wno-deprecated with bison
versions newer than 3.0, as non-Windows builds already do (Andrew
Dunstan)
Update time zone data files to tzdata
release 2020a for DST law changes in Morocco and the Canadian Yukon,
plus historical corrections for Shanghai.
The America/Godthab zone has been renamed to America/Nuuk to reflect
current English usage; however, the old name remains available as a
compatibility link.
Also, update initdb's list of known
Windows time zone names to include recent additions, improving the
odds that it will correctly translate the system time zone setting
on that platform.
Release 12.2Release date:2020-02-13
This release contains a variety of fixes from 12.1.
For information about new features in major release 12, see
.
Migration to Version 12.2
A dump/restore is not required for those running 12.X.
However, if you have any foreign key constraints referencing
partitioned tables, see the two entries below about bugs in that
feature.
Changes
Add missing permissions checks for ALTER ... DEPENDS ON
EXTENSION (Álvaro Herrera)
Marking an object as dependent on an extension did not have any
privilege check whatsoever. This oversight allowed any user to mark
routines, triggers, materialized views, or indexes as droppable by
anyone able to drop an extension. Require that the calling user own
the specified object (and hence have privilege to drop it).
(CVE-2020-1720)
Fix TRUNCATE ... CASCADE to ensure all relevant
partitions are truncated (Jehan-Guillaume de Rorthais)
If a partition of a partitioned table is truncated with
the CASCADE option, and the partitioned table has
a foreign-key reference from another table, that table must also be
truncated. The need to check this was missed if the referencing
table was itself partitioned, possibly allowing rows to survive that
violate the foreign-key constraint.
Hence, if you have foreign key constraints between partitioned
tables, and you have done any
partition-level TRUNCATE on the referenced table,
you should check to see if any foreign key violations exist. The
simplest way is to add a new instance of the foreign key constraint
(and, once that succeeds, drop it or the original constraint).
That may be prohibitive from a locking standpoint, however, in which
case you might prefer to manually query for unmatched rows.
Fix failure to attach foreign key constraints to sub-partitions
(Jehan-Guillaume de Rorthais)
When adding a partition to a level below the first level of a
multi-level partitioned table, foreign key constraints referencing
the top partitioned table were not cloned to the new partition,
leading to possible constraint violations later. Detaching and
re-attaching the new partition is the cheapest way to fix this.
However, if there are many partitions to be fixed, adding a new
instance of the foreign key constraint might be preferable.
Fix possible crash during concurrent update on a partitioned table
or inheritance tree (Tom Lane)
Ensure that row triggers on partitioned tables are correctly
cloned to sub-partitions when appropriate
(Álvaro Herrera)
User-defined triggers (but not triggers for foreign key or deferred
unique constraints) might be missed when creating or attaching a
partition.
Fix logical replication subscriber code to execute
per-column UPDATE triggers when appropriate
(Peter Eisentraut)
Avoid failure in logical decoding when a large transaction must be
spilled into many separate temporary files (Amit Khandekar)
Fix possible crash or data corruption when a logical replication
subscriber processes a row update (Tom Lane, Tomas Vondra)
This bug caused visible problems only if the subscriber's table
contained columns that were not being copied from the publisher and
had pass-by-reference data types.
Fix crash in logical replication subscriber after DDL changes on a
subscribed relation (Jehan-Guillaume de Rorthais, Vignesh C)
Fix failure in logical replication publisher after a database crash
and restart (Vignesh C)
Ensure that the effect
of pg_replication_slot_advance() on a physical
replication slot will persist across restarts (Alexey Kondratov,
Michael Paquier)
Improve efficiency of logical replication with REPLICA
IDENTITY FULL (Konstantin Knizhnik)
When searching for an existing tuple during an update or delete
operation, return the first matching tuple not the last one.
Fix base backup to handle database OIDs larger
than INT32_MAX (Peter Eisentraut)
Ensure parallel plans are always shut down at the correct time
(Kyotaro Horiguchi)
This oversight is known to result in temporary file
leak warnings from multi-batch parallel hash joins.
Prevent premature shutdown of a Gather or GatherMerge plan node that
is underneath a Limit node (Amit Kapila)
This avoids failure if such a plan node needs to be scanned more
than once, as for instance if it is on the inside of a nestloop.
Improve efficiency of parallel hash join on CPUs with many cores
(Gang Deng, Thomas Munro)
Avoid crash in parallel CREATE INDEX when there
are no free dynamic shared memory slots (Thomas Munro)
Fall back to a non-parallel index build, instead.
Avoid memory leak when there are no free dynamic shared memory slots
(Thomas Munro)
Ignore the CONCURRENTLY option when performing an
index creation, drop, or rebuild on a temporary table (Michael
Paquier, Heikki Linnakangas, Andres Freund)
This avoids strange failures if the temporary table has
an ON COMMIT action. There is no benefit in
using CONCURRENTLY for a temporary table anyway,
since other sessions cannot access the table, making the extra
processing pointless.
Fix possible failure when resetting expression indexes on temporary
tables that are marked ON COMMIT DELETE ROWS
(Tom Lane)
Fix possible crash in BRIN index operations
with box, range and inet data
types (Heikki Linnakangas)
Fix crash during recursive page split in GiST index build (Heikki
Linnakangas)
Fix handling of deleted pages in GIN indexes (Alexander Korotkov)
Avoid possible deadlocks, incorrect updates of a deleted page's
state, and failure to traverse through a recently-deleted page.
Fix possible crash with a SubPlan (sub-SELECT)
within a multi-row VALUES list (Tom Lane)
Fix failure in ALTER TABLE when a column
referenced in a GENERATED expression has been
added or changed in type earlier in the
same ALTER command (Tom Lane)
Fix failure to insert default values for missing
attributes during tuple conversion (Vik Fearing, Andrew Gierth)
This could result in values incorrectly reading as NULL, when
they come from columns that had been added by ALTER
TABLE ADD COLUMN with a constant default.
Fix unlikely panic in the checkpointer process, caused by opening
relation segments that might already have been removed (Thomas Munro)
Fix crash after FileClose() failure (Noah Misch)
This issue could only be observed
with data_sync_retry enabled, since otherwise
FileClose() failure would be reported as a PANIC.
Fix handling of multiple AFTER ROW triggers on a
foreign table (Etsuro Fujita)
Fix unlikely crash with pass-by-reference aggregate transition
states (Andres Freund, Teodor Sigaev)
Improve error reporting in to_date()
and to_timestamp()
(Tom Lane, Álvaro Herrera)
Reports about incorrect month or day names in input strings could
truncate the input in the middle of a multi-byte character, leading
to an improperly encoded error message that could cause follow-on
failures. Truncate at the next whitespace instead.
Fix off-by-one result for EXTRACT(ISOYEAR
FROM timestamp) for BC dates
(Tom Lane)
Ensure that the <> operator for
type char reports indeterminate-collation errors as
such, rather than as cache lookup failed for collation
0 (Tom Lane)
Avoid treating TID scans as sequential scans (Tatsuhito Kasahara)
A refactoring oversight caused TID scans (selection by CTID) to be
counted as sequential scans in the statistics views, and to take
whole-table predicate locks as sequential scans do. The latter
behavior could cause unnecessary serialization errors in
serializable transaction mode.
Avoid stack overflow in information_schema views
when a self-referential view exists in the system catalogs
(Tom Lane)
A self-referential view can't work; it will always result in
infinite recursion. We handled that situation correctly when
trying to execute the view, but not when inquiring whether it is
automatically updatable.
Ensure that walsender processes always show NULL for transaction
start time in pg_stat_activity
(Álvaro Herrera)
Previously, the xact_start column would
sometimes show the process start time.
Improve performance of hash joins with very large inner relations
(Thomas Munro)
Reduce spinlock contention when there are many active walsender
processes (Pierre Ducroquet)
Fix placement of Subplans Removed field
in EXPLAIN output (Daniel Gustafsson, Tom Lane)
In non-text output formats, this field was emitted inside
the Plans sub-group, resulting in syntactically
invalid output. Attach it to the parent Append or MergeAppend plan
node as intended. This causes the field to change position in text
output format too: if there are any InitPlans attached to the same
plan node, Subplans Removed will now appear before
those.
Fix EXPLAIN's SETTINGS option
to print as empty in non-text output formats (Tom Lane)
In the non-text output formats, fields are supposed to appear when
requested, even if they have empty or zero values.
Allow the planner to apply potentially-leaky tests to child-table
statistics, if the user can read the corresponding column of the
table that's actually named in the query (Dilip Kumar, Amit Langote)
This change fixes a performance problem for partitioned tables that
was created by the fix for CVE-2017-7484. That security fix
disallowed applying leaky operators to statistics for columns that
the current user doesn't have permission to read directly. However,
it's somewhat common to grant permissions only on the parent
partitioned table and not bother to do so on individual partitions.
In such cases, the user can read the column via the parent, so
there's no point in this security restriction; it only results in
poorer planner estimates than necessary.
Fix planner errors induced by overly-aggressive collapsing of joins
to single-row subqueries (Tom Lane)
This mistake led to errors such as failed to construct the
join relation.
Fix no = operator for
opfamily NNNN planner error when
trying to match a LIKE or regex pattern-match
operator to a binary-compatible index opclass (Tom Lane)
Fix edge-case crashes and misestimations in selectivity calculations
for the <@ and @> range
operators (Michael Paquier, Andrey Borodin, Tom Lane)
Fix incorrect estimation for OR clauses when
using most-common-value extended statistics (Tomas Vondra)
Ignore system columns when applying most-common-value
extended statistics (Tomas Vondra)
This prevents negative bitmapset member not allowed
planner errors for affected queries.
Fix BRIN index logic to support hypothetical BRIN indexes
(Julien Rouhaud, Heikki Linnakangas)
Previously, if an index adviser extension tried to
get the planner to produce a plan involving a hypothetical BRIN
index, that would fail, because the BRIN cost estimation code would
always try to physically access the index's metapage. Now it checks
to see if the index is only hypothetical, and uses default
assumptions about the index parameters if so.
Improve error reporting for attempts to use automatic updating of
views with conditional INSTEAD rules (Dean Rasheed)
This has never been supported, but previously the error was thrown
only at execution time, so that it could be masked by planner errors.
Prevent a composite type from being included in itself indirectly
via a range type (Tom Lane, Julien Rouhaud)
Disallow partition key expressions that return pseudo-types, such
as record (Tom Lane)
Fix error reporting for index expressions of prohibited types
(Amit Langote)
Fix dumping of views that contain only a VALUES
list to handle cases where a view output column has been renamed
(Tom Lane)
Ensure that data types and collations used
in XMLTABLE constructs are accounted for when
computing dependencies of a view or rule (Tom Lane)
Previously it was possible to break a view
using XMLTABLE by dropping a type, if the type
was not otherwise referenced in the view. This fix does not
correct the dependencies already recorded for existing views, only
for newly-created ones.
Prevent unwanted downcasing and truncation of RADIUS authentication
parameters (Marcos David)
The pg_hba.conf parser mistakenly treated these
fields as SQL identifiers, which in general they aren't.
Transmit incoming NOTIFY messages to the client
before sending ReadyForQuery, rather than after
(Tom Lane)
This change ensures that, with libpq and other client libraries that
act similarly to it, any notifications received during a transaction
will be available by the time the client thinks the transaction is
complete. This probably makes no difference in practical
applications (which would need to cope with asynchronous
notifications in any case); but it makes it easier to build test
cases with reproducible behavior.
Fix bugs in handling of non-blocking I/O when using GSSAPI
encryption (Tom Lane)
These errors could result in dropping data (usually leading to
subsequent wire-protocol-violation errors) or in
a livelock situation where a sending process goes to
sleep although not all its data has been sent.
Moreover, libpq failed to keep separate
encryption state for each connection, creating the possibility for
failures in applications using multiple encrypted database
connections.
Allow libpq to parse all GSS-related
connection parameters even when the GSSAPI code hasn't been compiled
in (Tom Lane)
This makes the behavior similar to our SSL support, where it was
long ago deemed to be a good idea to always accept all the related
parameters, even if some are ignored or restricted due to lack of
the feature in a particular build.
Fix incorrect handling of %b
and %B format codes
in ecpg's
PGTYPEStimestamp_fmt_asc() function
(Tomas Vondra)
Due to an off-by-one error, these codes would print the wrong month
name, or possibly crash.
Avoid crash after an out-of-memory failure
in ecpglib (Tom Lane)
Fix
parallel pg_dump/pg_restore
to more gracefully handle failure to create worker processes
(Tom Lane)
Prevent possible crash or lockup when attempting to terminate a
parallel pg_dump/pg_restore
run via a signal (Tom Lane)
In pg_upgrade, look inside arrays and
ranges while searching for non-upgradable data types in tables
(Tom Lane)
Apply more thorough syntax checking
to createuser's
option (Álvaro Herrera)
Cope with changes of the specific type referenced by a PL/pgSQL
composite-type variable in more cases (Ashutosh Sharma, Tom Lane)
Dropping and re-creating the composite type referenced by a PL/pgSQL
variable could lead to could not open relation with
OID NNNN errors.
Avoid crash in postgres_fdw when trying to
send a command like UPDATE remote_tab SET (x,y) = (SELECT
...) to the remote server (Tom Lane)
In contrib/dict_int,
reject maxlen settings less than one
(Tomas Vondra)
This prevents a possible crash with silly settings for that parameter.
Disallow NULL category values
in contrib/tablefunc's
crosstab() function (Joe Conway)
This case never worked usefully, and it would crash on some
platforms.
Fix configure's probe for
OpenSSL's SSL_clear_options() function so that
it works with OpenSSL versions before 1.1.0 (Michael Paquier, Daniel
Gustafsson)
This problem could lead to failure to set the SSL compression option
as desired, when PostgreSQL is built against
an old version of OpenSSL.
Mark some timeout and statistics-tracking GUC variables
as PGDLLIMPORT, to allow extensions to access
them on Windows (Pascal Legrand)
This applies to
idle_in_transaction_session_timeout,
lock_timeout,
statement_timeout,
track_activities,
track_counts, and
track_functions.
Avoid memory leak in sanity checks for slab memory
contexts (Tomas Vondra)
This isn't an issue for production builds, since they wouldn't
ordinarily have memory context checking enabled; but the leak could
be quite severe in a debug build.
Fix multiple statistics entries reported by the LWLock statistics
mechanism (Fujii Masao)
The LWLock statistics code (which is not built by default; it
requires compiling with )
could report multiple entries for the same LWLock and backend
process, as a result of faulty hashtable key creation.
Fix race condition that led to delayed delivery of interprocess
signals on Windows (Amit Kapila)
This caused visible timing oddities in NOTIFY,
and perhaps other misbehavior.
Fix handling of a corner-case error result from
Windows' ReadFile() function
(Thomas Munro, Juan José Santamaría Flecha)
So far as is known, this oversight just resulted in noisy log
messages, not any actual query misbehavior.
On Windows, retry a few times after
an ERROR_ACCESS_DENIED file access failure
(Alexander Lakhin, Tom Lane)
This helps cope with cases where a file open attempt fails because
the targeted file is flagged for deletion but not yet actually gone.
pg_ctl, for example, frequently failed
with such an error when probing to see if the postmaster had shut
down yet.
On Windows, work around sharing violations for the postmaster's log
file when pg_ctl is used to start the
postmaster very shortly after it's been stopped, for example by
pg_ctl restart (Alexander Lakhin)
Release 12.1Release date:2019-11-14
This release contains a variety of fixes from 12.0.
For information about new features in major release 12, see
.
Migration to Version 12.1
A dump/restore is not required for those running 12.X.
Changes
Fix crash when ALTER TABLE adds a column without
a default value along with making other changes that require a table
rewrite (Andres Freund)
Fix lock handling in REINDEX CONCURRENTLY
(Michael Paquier)
REINDEX CONCURRENTLY neglected to take a
session-level lock on the new index version, potentially allowing
other sessions to manipulate it too soon.
Also, a query-cancel or session-termination interrupt arriving at the
wrong time could result in failure to release the session-level
locks that REINDEX CONCURRENTLY does hold.
Avoid crash due to race condition when reporting the progress of
a CREATE INDEX CONCURRENTLY or REINDEX
CONCURRENTLY command (Álvaro Herrera)
Avoid creating duplicate dependency entries during REINDEX
CONCURRENTLY (Michael Paquier)
This bug resulted in bloat in pg_depend,
but no worse consequences than that.
Prevent VACUUM from trying to freeze
an old multixact ID involving a still-running transaction
(Nathan Bossart, Jeremy Schneider)
This case would lead to VACUUM failing until the
old transaction terminates.
Fix wrong type of slot error when trying
to CLUSTER on an expression index (Andres Freund)
SET CONSTRAINTS ... DEFERRED failed on
partitioned tables, incorrectly complaining about lack of triggers
(Álvaro Herrera)
Fix failure when creating indexes for a partition, if the parent
partitioned table contains any dropped columns (Michael Paquier)
Fix dropping of indexed columns in partitioned tables
(Amit Langote, Michael Paquier)
Previously this might fail with an error message complaining about
the dependencies of the indexes. It should automatically drop the
indexes, instead.
Ensure that a partition index can be dropped after a failure to
reindex it concurrently (Michael Paquier)
The
index's pg_class.relispartition
flag was left in the wrong state in such a case,
causing DROP INDEX to fail.
Fix handling of equivalence class members for partition-wise joins
(Amit Langote)
This oversight could lead either to failure to use a feasible
partition-wise join plan, or to a could not find pathkey item
to sort planner failure.
Ensure that offset expressions in WINDOW clauses
are processed when a query's expressions are manipulated (Andrew Gierth)
This oversight could result in assorted failures when the offsets
are nontrivial expressions. One example is that a function
parameter reference in such an expression would fail if the function
was inlined.
Avoid postmaster failure if a parallel query requests a background
worker when no postmaster child process array slots remain free
(Tom Lane)
Fix crash triggered by an EvalPlanQual recheck on a table with
a BEFORE UPDATE trigger (Andres Freund)
Fix unexpected relkind error when a query tries to
access a TOAST table (John Hsu, Michael Paquier, Tom Lane)
The error should say that permission is denied, but this case got
broken during code refactoring.
Provide a relevant error context line when an error occurs while
setting GUC parameters during parallel worker startup (Thomas Munro)
Ensure that fsync() is applied only to files
that are opened read/write (Andres Freund, Michael Paquier)
Some code paths tried to do this after opening a file read-only,
but on some platforms that causes bad file descriptor
or similar errors.
Allow encoding conversion to succeed on longer strings than before
(Álvaro Herrera, Tom Lane)
Previously, there was a hard limit of 0.25GB on the input string,
but now it will work as long as the converted output is not over 1GB.
Avoid creating unnecessarily-bulky tuple stores for window functions
(Andrew Gierth)
In some cases the tuple storage would include all columns of the
source table(s), not just the ones that are needed by the query.
Allow repalloc() to give back space when a
large chunk is reduced in size (Tom Lane)
Ensure that temporary WAL and history files are removed at the end
of archive recovery (Sawada Masahiko)
Avoid failure in archive recovery
if recovery_min_apply_delay is enabled
(Fujii Masao)
recovery_min_apply_delay is not typically used in
this configuration, but it should work.
Ignore restore_command,
recovery_end_command,
and recovery_min_apply_delay settings during
crash recovery (Fujii Masao)
Now that these settings can be specified
in postgresql.conf, they could be turned on
during crash recovery, but honoring them then is undesirable.
Ignore these settings until crash recovery is complete.
Fix logical replication failure when publisher and subscriber have
different ideas about a table's replica identity columns
(Jehan-Guillaume de Rorthais, Peter Eisentraut)
Declaring a column as part of the replica identity on the
subscriber, when it does not exist at all on the publisher, led
to negative bitmapset member not allowed errors.
Avoid unwanted delay during shutdown of a logical replication
walsender (Craig Ringer, Álvaro Herrera)
Fix timeout handling in logical replication walreceiver processes
(Julien Rouhaud)
Erroneous logic prevented wal_receiver_timeout
from working in logical replication deployments.
Correctly time-stamp replication messages for logical
decoding (Jeff Janes)
This oversight resulted, for example,
in pg_stat_subscription.last_msg_send_time
usually reading as NULL.
Fix race condition during backend exit, when the backend process has
previously waited for synchronous replication to occur (Dongming Liu)
Avoid logging complaints about abandoned connections when using PAM
authentication (Tom Lane)
libpq-based clients will typically make two connection attempts when
a password is required, since they don't prompt their user for a
password until their first connection attempt fails. Therefore the
server is coded not to generate useless log spam when a client
closes the connection upon being asked for a password. However,
the PAM authentication code hadn't gotten that memo, and would
generate several messages about a phantom authentication failure.
Fix misbehavior of bitshiftright() (Tom Lane)
The bitstring right shift operator failed to zero out padding space
that exists in the last byte of the result when the bitstring length
is not a multiple of 8. While invisible to most operations, any
nonzero bits there would result in unexpected comparison behavior,
since bitstring comparisons don't bother to ignore the extra bits,
expecting them to always be zero.
If you have inconsistent data as a result of saving the output
of bitshiftright() in a table, it's possible to
fix it with something like
UPDATE mytab SET bitcol = ~(~bitcol) WHERE bitcol != ~(~bitcol);
Fix result of text position() function (also
known as strpos()) for an empty search string
(Tom Lane)
Historically, and per the SQL standard, the result should be one in
such cases, but 12.0 returned zero.
Fix detection of edge-case integer overflow in interval
multiplication (Yuya Watari)
Avoid crashes if ispell text search dictionaries
contain wrong affix data (Arthur Zakirov)
Avoid memory leak while vacuuming a GiST index (Dilip Kumar)
On Windows, recognize additional spellings of the Norwegian
(Bokmål) locale name (Tom Lane)
Fix libpq to allow trailing whitespace in
the string values of integer parameters (Michael Paquier)
Version 12 tightened libpq's validation
of integer parameters, but disallowing trailing whitespace seems
undesirable.
In libpq, correctly
report CONNECTION_BAD connection status after a
failure caused by a syntactically
invalid parameter value (Lars Kanis)
Avoid compile failure if an ECPG client
includes ecpglib.h while
having ENABLE_NLS defined (Tom Lane)
This risk was created by a misplaced
declaration: ecpg_gettext() should not be
visible to client code.
Fix scheduling of parallel restore of a foreign key constraint on a
partitioned table (Álvaro Herrera)
pg_dump failed to emit full dependency
information for partitioned tables' foreign keys. This could allow
parallel pg_restore to try to recreate a
foreign key constraint too soon.
In pg_dump, ensure stable output order
for similarly-named triggers and row-level-security policy objects
(Benjie Gillam)
Previously, if two triggers on different tables had the same names,
they would be sorted in OID-based order, which is less desirable
than sorting them by table name. Likewise for RLS policies.
In pg_upgrade, reject tables with
columns of type sql_identifier, as that has changed
representation in version 12 (Tomas Vondra)
Improve pg_upgrade's checks for the use
of a data type that has changed representation, such
as line (Tomas Vondra)
The previous coding could be fooled by cases where the data type of
interest underlies a stored column of a domain or composite type.
In pg_rewind
with the option, avoid
updating pg_control
(Alexey Kondratov)
This could lead to failures in
subsequent pg_rewind attempts.
Fix failure in pg_waldump with
the option, when a continuation WAL record ends
exactly at a page boundary (Andrey Lepikhov)
In pg_waldump with
the option, avoid emitting extra
newlines for WAL records involving full-page writes (Andres Freund)
Fix small memory leak in pg_waldump
(Andres Freund)
Put back pqsignal() as an
exported libpq symbol (Tom Lane)
This function was removed on the grounds that no clients should be
using it, but that turns out to break usage of
current libpq with very old versions
of psql, and perhaps other applications.
Fix configure's test for presence of
libperl so that it works on recent Red Hat releases (Tom Lane)
Previously, it could fail if the user sets CFLAGS
to -O0.
Ensure correct code generation for spinlocks on PowerPC (Noah Misch)
The previous spinlock coding allowed the compiler to select register
zero for use with an assembly instruction that does not accept that
register, causing a build failure. We have seen only one long-ago
report that matches this bug, but it could cause problems for people
trying to build modified PostgreSQL code
or use atypical compiler options.
On AIX, don't use the compiler option
(Noah Misch)
This avoids an internal compiler error with xlc v16.1.0, with little
consequence other than changing the format of compiler error messages.
Fix MSVC build process to cope with spaces in the file path of
OpenSSL (Andrew Dunstan)
Release 12Release date:2019-10-03Overview
Major enhancements in PostgreSQL 12 include:
General performance improvements, including:
Optimizations to space utilization and read/write performance for
B-tree indexes
Partitioning performance enhancements, including improved query
performance on tables with thousands of partitions, improved
insertion performance with and , and the ability to execute ALTER TABLE ATTACH
PARTITION without blocking queries
Automatic (but overridable) inlining
of common table expressions
(CTEs)
Reduction of WAL overhead for creation of
GiST, GIN, and
SP-GiST indexes
Support for covering GiST indexes, via
the INCLUDE
clause
Multi-column most-common-value (MCV) statistics can be defined
via , to support better
plans for queries that test several non-uniformly-distributed
columns
Enhancements to administrative functionality, including:
REINDEX
CONCURRENTLY can rebuild an index without
blocking writes to its table
can enable/disable page checksums
(used for detecting data corruption) in an offline cluster
Progress reporting statistics for ,
, ,
VACUUM FULL, and
Support for the SQL/JSON
path language
Stored generated columns
Nondeterministic ICU
collations, enabling case-insensitive and accent-insensitive grouping
and ordering
New authentication features, including:
Encryption of TCP/IP connections when using
GSSAPI
authentication
Discovery of LDAP servers using DNS SRV records
Multi-factor authentication, using the
clientcert=verify-full option combined
with an additional authentication method in
pg_hba.conf
The above items are explained in more detail in the sections below.
Migration to Version 12
A dump/restore using or use of or logical replication is required for those
wishing to migrate data from any previous release. See for general information on migrating to new major
releases.
Version 12 contains a number of changes that may affect compatibility
with previous releases. Observe the following incompatibilities:
Remove the special behavior of oid columns (Andres Freund,
John Naylor)
Previously, a normally-invisible oid
column could be specified during table creation using WITH
OIDS; that ability has been removed. Columns can still be
explicitly declared as type oid. Operations on tables
that have columns created using WITH OIDS will
need adjustment.
The system catalogs that previously had
hidden oid columns now have
ordinary oid columns.
Hence, SELECT * will now output those columns,
whereas previously they would be displayed only if selected
explicitly.
Remove data types abstime, reltime,
and tinterval (Andres Freund)
These are obsoleted by SQL-standard types such
as timestamp.
Remove the timetravel extension
(Andres Freund)
Move recovery.conf settings into postgresql.conf
(Masao Fujii, Simon Riggs, Abhijit Menon-Sen, Sergei Kornilov)
recovery.conf is no longer used,
and the server will not start if that file exists. recovery.signal
and standby.signal files are now used to switch
into non-primary mode. The trigger_file setting
has been renamed to . The
standby_mode setting has been removed.
Do not allow multiple conflicting recovery_target*
specifications (Peter Eisentraut)
Specifically, only allow one of , ,
,
, and . Previously, multiple different
instances of these parameters could be specified, and the last one
was honored. Now, only one can be specified, though the same one can
be specified multiple times and the last specification is honored.
Cause recovery to advance to the latest timeline by default
(Peter Eisentraut)
Specifically, now
defaults to latest. Previously, it defaulted
to current.
Refactor code for geometric
functions and operators (Emre Hasegeli)
This could lead to more accurate, but slightly different, results
compared to previous releases. Notably, cases involving NaN,
underflow, overflow, and division by zero are handled more
consistently than before.
Improve performance by using a new algorithm for output
of real
and double precision values (Andrew Gierth)
Previously, displayed floating-point values were rounded to 6
(for real) or 15 (for double precision)
digits by default, adjusted by the value of
. Now,
whenever extra_float_digits is more than zero (as
it now is by default), only the minimum number of digits required to
preserve the exact binary value are output. The behavior is the
same as before when extra_float_digits is set to
zero or less.
Also, formatting of floating-point exponents is now uniform across
platforms: two digits are used unless three are necessary. In
previous releases, Windows builds always printed three digits.
random()
and setseed() now behave uniformly across
platforms (Tom Lane)
The sequence of random() values generated
following a setseed() call with a particular
seed value is likely to be different now than before. However, it
will also be repeatable, which was not previously guaranteed because
of interference from other uses of random numbers inside the server.
The SQL random() function now has its own
private per-session state to forestall that.
Change SQL-style
substring()
to have standard-compliant greediness behavior (Tom Lane)
In cases where the pattern can be matched in more than one way, the
initial sub-pattern is now treated as matching the least possible
amount of text rather than the greatest; for example, a pattern such
as %#"aa*#"% now selects the first group
of a's from the input, not the last group.
Do not pretty-print the result
of xpath()
or the XMLTABLE construct (Tom Lane)
In some cases, these functions would insert extra whitespace
(newlines and/or spaces) in nodeset values. This is undesirable
since depending on usage, the whitespace might be considered
semantically significant.
Rename command-line tool
pg_verify_checksums to (Michaël Paquier)
In , require specification of
-f - to send the dump contents to standard output
(Euler Taveira)
Previously, this happened by default if no destination was
specified, but that was deemed to be unfriendly.
Disallow non-unique abbreviations
in psql's \pset format
command (Daniel Vérité)
Previously, for example, \pset format a chose
aligned; it will now fail since that could
equally well mean asciidoc.
In new btree indexes, the maximum index entry length is
reduced by eight bytes, to improve handling of duplicate entries
(Peter Geoghegan)
This means that a operation on an
index pg_upgrade'd from a previous
release could potentially fail.
Cause DROP IF EXISTS
FUNCTION/PROCEDURE/AGGREGATE/ROUTINE
to generate an error if no argument list is supplied and there are
multiple matching objects (David Rowley)
Also improve the error message in such cases.
Split the pg_statistic_ext
catalog into two catalogs, and add the pg_stats_ext
view of it (Dean Rasheed, Tomas Vondra)
This change supports hiding potentially-sensitive statistics data
from unprivileged users.
Remove obsolete pg_constraint.consrc
column (Peter Eisentraut)
This column has been deprecated for a long time, because it did not
update in response to other catalog changes (such as column renamings).
The recommended way to get a text version of a check constraint's
expression from pg_constraint
is pg_get_expr(conbin, conrelid).
pg_get_constraintdef() is also a useful
alternative.
Remove obsolete pg_attrdef.adsrc
column (Peter Eisentraut)
This column has been deprecated for a long time, because it did not
update in response to other catalog changes (such as column renamings).
The recommended way to get a text version of a default-value expression
from pg_attrdef is pg_get_expr(adbin,
adrelid).
Mark table columns of type name as having
C collation by default (Tom Lane, Daniel Vérité)
The comparison operators for data type name can now use
any collation, rather than always using C collation.
To preserve the previous semantics of queries, columns of
type name are now explicitly marked as
having C collation. A side effect of this is that
regular-expression operators on name columns will now
use the C collation by default, not the database
collation, to determine the behavior of locale-dependent regular
expression patterns (such as \w). If you want
non-C behavior for a regular expression on a name
column, attach an explicit COLLATE clause. (For
user-defined name columns, another possibility is to
specify a different collation at table creation time; but that just
moves the non-backwards-compatibility to the comparison operators.)
Treat object-name columns in
the information_schema
views as being of type name, not varchar
(Tom Lane)
Per the SQL standard, object-name columns in
the information_schema views are declared
as being of domain type sql_identifier.
In PostgreSQL, the underlying catalog
columns are really of type name. This change
makes sql_identifier be a domain
over name, rather than varchar as before.
This eliminates a semantic mismatch in comparison and sorting
behavior, which can greatly improve the performance of queries
on information_schema views that restrict
an object-name column. Note however that inequality restrictions,
for example
SELECT ... FROM information_schema.tables WHERE table_name < 'foo';
will now use C-locale comparison semantics by
default, rather than the database's default collation as before.
Sorting on these columns will also follow C ordering
rules. The previous behavior (and inefficiency) can be enforced by
adding a COLLATE "default" clause.
Remove the ability to disable dynamic shared memory (Kyotaro
Horiguchi)
Specifically,
can no longer be set to none.
Parse libpq integer connection parameters more strictly (Fabien
Coelho)
In previous releases, using an incorrect integer value for
connection parameters connect_timeout,
keepalives, keepalives_count,
keepalives_idle,
keepalives_interval and port
resulted in libpq either ignoring those values or failing with
incorrect error messages.
Changes
Below you will find a detailed account of the changes between
PostgreSQL 12 and the previous
major release.
ServerPartitioning
Improve performance of many operations on partitioned tables
(Amit Langote, David Rowley, Tom Lane, Álvaro Herrera)
Allow tables with thousands of child partitions to be processed
efficiently by operations that only affect a small number of
partitions.
Allow foreign keys
to reference partitioned tables (Álvaro Herrera)
Improve speed of COPY into partitioned tables
(David Rowley)
Allow partition bounds to be any expression (Kyotaro Horiguchi,
Tom Lane, Amit Langote)
Such expressions are evaluated at partitioned-table creation time.
Previously, only simple constants were allowed as partition bounds.
Allow CREATE TABLE's tablespace specification
for a partitioned table to affect the tablespace of its children
(David Rowley, Álvaro Herrera)
Avoid sorting when partitions are already being scanned in the
necessary order (David Rowley)
ALTER TABLE ATTACH
PARTITION is now performed with reduced locking
requirements (Robert Haas)
Add partition introspection functions (Michaël Paquier, Álvaro
Herrera, Amit Langote)
The new function pg_partition_root()
returns the top-most parent of a partition tree, pg_partition_ancestors()
reports all ancestors of a partition, and pg_partition_tree()
displays information about partitions.
Include partitioned indexes in the system view pg_indexes
(Suraj Kharage)
Add psql command \dP
to list partitioned tables and indexes (Pavel Stehule)
Improve psql\d
and \z display of partitioned tables (Pavel
Stehule, Michaël Paquier, Álvaro Herrera)
Fix bugs that could cause ALTER TABLE DETACH
PARTITION to leave behind incorrect dependency state,
allowing subsequent operations to misbehave, for example by not
dropping a former partition child index when its table is dropped
(Tom Lane)
Indexes
Improve performance and space utilization of btree indexes with
many duplicates (Peter Geoghegan, Heikki Linnakangas)
Previously, duplicate index entries were stored unordered within
their duplicate groups. This caused overhead during index
inserts, wasted space due to excessive page splits, and it reduced
VACUUM's ability to recycle entire pages.
Duplicate index entries are now sorted in heap-storage order.
Indexes pg_upgrade'd from previous
releases will not have these benefits.
Allow multi-column btree indexes to be smaller (Peter Geoghegan,
Heikki Linnakangas)
Internal pages and min/max leaf page indicators now only store
index keys until the change key, rather than all indexed keys.
This also improves the locality of index access.
Indexes pg_upgrade'd from previous
releases will not have these benefits.
Improve speed of btree index insertions by reducing locking
overhead (Alexander Korotkov)
Support INCLUDE columns
in GiST indexes (Andrey Borodin)
Add support for nearest-neighbor (KNN) searches
of SP-GiST indexes (Nikita Glukhov,
Alexander Korotkov, Vlad Sterzhanov)
Reduce the WAL write overhead
of GiST, GIN, and
SP-GiST index creation (Anastasia Lubennikova,
Andrey V. Lepikhov)
Allow index-only scans to be more efficient on indexes with many
columns (Konstantin Knizhnik)
Improve the performance of vacuum scans of GiST indexes (Andrey
Borodin, Konstantin Kuznetsov, Heikki Linnakangas)
Delete empty leaf pages during GiST
VACUUM (Andrey Borodin)
Reduce locking requirements for index renaming (Peter Eisentraut)
Optimizer
Allow to create
most-common-value statistics for multiple columns (Tomas Vondra)
This improves optimization for queries that test several columns,
requiring an estimate of the combined effect of
several WHERE clauses. If the columns are
correlated and have non-uniform distributions then multi-column
statistics will allow much better estimates.
Allow common table expressions
(CTEs) to be inlined into the outer query
(Andreas Karlsson, Andrew Gierth, David Fetter, Tom Lane)
Specifically, CTEs are automatically inlined if
they have no side-effects, are not recursive, and are referenced
only once in the query. Inlining can be prevented by
specifying MATERIALIZED, or forced for
multiply-referenced CTEs by
specifying NOT MATERIALIZED. Previously,
CTEs were never inlined and were always
evaluated before the rest of the query.
Allow control over when generic plans are used for prepared
statements (Pavel Stehule)
This is controlled by the
server parameter.
Improve optimization of partition and UNION ALL
queries that have only a single child (David Rowley)
Improve processing of domains that
have no check constraints (Tom Lane)
Domains that are being used purely as type aliases no longer cause
optimization difficulties.
Pre-evaluate calls of LEAST
and GREATEST when their arguments are constants
(Vik Fearing)
Improve optimizer's ability to verify that partial indexes
with IS NOT NULL conditions are usable in
queries (Tom Lane, James Coleman)
Usability can now be recognized in more cases where the calling
query involves casts or
large x IN
(array) clauses.
Compute ANALYZE statistics using the collation
defined for each column (Tom Lane)
Previously, the database's default collation was used for all
statistics. This potentially gives better optimizer behavior for
columns with non-default collations.
Improve selectivity estimates for inequality comparisons
on ctid
columns (Edmund Horner)
Improve optimization of joins on columns of type tid
(Tom Lane)
These changes primarily improve the efficiency of self-joins
on ctid columns.
Fix the leakproofness designations of some btree comparison operators
and support functions (Tom Lane)
This allows some optimizations that previously would not have been
applied in the presence of security barrier views or row-level
security.
General Performance
Enable Just-in-Time
(JIT) compilation by default, if the server
has been built with support for it (Andres Freund)
Note that this support is not built by default, but has to be
selected explicitly while configuring the build.
Speed up keyword lookup (John Naylor, Joerg Sonnenberger, Tom Lane)
Improve search performance for multi-byte characters
in position() and related functions (Heikki
Linnakangas)
Allow toasted
values to be minimally decompressed (Paul Ramsey)
This is useful for routines that only need to examine the initial
portion of a toasted field.
Allow ALTER TABLE ... SET
NOT NULL to avoid unnecessary table scans (Sergei
Kornilov)
This can be optimized when the table's column constraints can be
recognized as disallowing nulls.
Allow ALTER TABLE ... SET DATA TYPE changing between
timestamp and timestamptz to avoid a
table rewrite when the session time zone is UTC
(Noah Misch)
In the UTC time zone, these two data types are
binary compatible.
Improve speed in converting strings to
int2 or int4 integers (Andres Freund)
Allow parallelized queries when in SERIALIZABLE
isolation mode (Thomas Munro)
Previously, parallelism was disabled when in this mode.
Use pread() and pwrite()
for random I/O (Oskari Saarenmaa, Thomas Munro)
This reduces the number of system calls required for I/O.
Improve the speed of setting the process title on
FreeBSD (Thomas Munro)
Monitoring
Allow logging of statements from only a percentage of transactions
(Adrien Nayrat)
The parameter
controls this.
Add progress reporting to CREATE INDEX and
REINDEX operations (Álvaro Herrera, Peter
Eisentraut)
Progress is reported in the pg_stat_progress_create_index
system view.
Add progress reporting to CLUSTER and
VACUUM FULL (Tatsuro Yamada)
Progress is reported in the pg_stat_progress_cluster
system view.
Add progress reporting to
(Michael Banck, Bernd Helmle)
This is enabled with the option .
Add counter of checksum failures to
pg_stat_database (Magnus Hagander)
Add tracking of global objects in system view
pg_stat_database (Julien Rouhaud)
Global objects are shown with a pg_stat_database.datid
value of zero.
Add the ability to list the contents of the archive directory
(Christoph Moench-Tegeder)
The function is pg_ls_archive_statusdir().
Add the ability to list the contents of temporary directories
(Nathan Bossart)
The function, pg_ls_tmpdir(),
optionally allows specification of a tablespace.
Add information about the client certificate to the system view pg_stat_ssl
(Peter Eisentraut)
The new columns are client_serial
and issuer_dn. Column
clientdn has been renamed to
client_dn for clarity.
Restrict visibility of rows in pg_stat_ssl
for unprivileged users (Peter Eisentraut)
At server start, emit a log message including the server
version number (Christoph Berg)
Prevent logging incomplete startup packet if a new
connection is immediately closed (Tom Lane)
This avoids log spam from certain forms of monitoring.
Include the , if set,
in log messages (Don Seiler)
Make the walreceiver set its application name to the cluster name,
if set (Peter Eisentraut)
Add the timestamp of the last received standby message to pg_stat_replication
(Lim Myungkyu)
Add a wait event for fsync
of WAL segments (Konstantin Knizhnik)
Authentication
Add GSSAPI
encryption support (Robbie Harwood, Stephen Frost)
This feature allows TCP/IP connections to be encrypted when using
GSSAPI authentication, without having to set up a separate
encryption facility such as SSL.
In support of this, add hostgssenc
and hostnogssenc record types in pg_hba.conf
for selecting connections that do or do not use GSSAPI encryption,
corresponding to the existing hostssl
and hostnossl record types.
There is also a new
libpq option, and a system
view.
Allow the clientcertpg_hba.conf option to check that the database
user name matches the client certificate's common name
(Julian Markwort, Marius Timmer)
This new check is enabled with
clientcert=verify-full.
Allow discovery of an LDAP server using
DNS SRV records (Thomas Munro)
This avoids the requirement of specifying
ldapserver. It is only supported if
PostgreSQL is compiled with
OpenLDAP.
Server Configuration
Add ability to enable/disable cluster checksums using (Michael Banck, Michaël Paquier)
The cluster must be shut down for these operations.
Reduce the default value of to 2ms (Tom Lane)
This allows autovacuum operations to proceed faster by default.
Allow to specify
sub-millisecond delays, by accepting fractional values (Tom Lane)
Allow time-based server parameters to use units of microseconds
(us) (Tom Lane)
Allow fractional input for integer server parameters (Tom Lane)
For example, SET work_mem = '30.1GB' is now
allowed, even though work_mem is an integer
parameter. The value will be rounded to an integer after any
required units conversion.
Allow units to be defined for floating-point server parameters
(Tom Lane)
Add and server parameters to control
WAL file recycling (Jerry Jelinek)
Avoiding file recycling can be beneficial on copy-on-write file
systems like ZFS.
Add server parameter to
control the server's TCP timeout (Ryohei Nagaura)
Allow control of the minimum and maximum SSL
protocol versions (Peter Eisentraut)
The server parameters are and .
Add server parameter to report
the SSL library version used by the server
(Peter Eisentraut)
Add server parameter
to control the type of shared memory to use (Andres Freund)
This allows selection of System V
shared memory, if desired.
Streaming Replication and Recovery
Allow some recovery parameters to be changed with reload (Peter
Eisentraut)
These parameters are ,
, , and .
Allow the streaming replication timeout () to be set per connection
(Takayuki Tsunakawa)
Previously, this could only be set cluster-wide.
Add function pg_promote()
to promote standbys to primaries (Laurenz Albe, Michaël Paquier)
Previously, this operation was only possible by using or creating a trigger file.
Allow replication slots to be copied (Masahiko Sawada)
The functions for this are pg_copy_physical_replication_slot()
and pg_copy_logical_replication_slot().
Make not count as part of
(Alexander Kukushkin)
Add an explicit value of current for (Peter Eisentraut)
Make recovery fail if a two-phase transaction
status file is corrupt (Michaël Paquier)
Previously, a warning was logged and recovery continued,
allowing the transaction to be lost.
Utility Commands
Add CONCURRENTLY
option to allow reindexing without locking out writes (Michaël
Paquier, Andreas Karlsson, Peter Eisentraut)
This is also controlled by the
application's option.
Add support for generated
columns (Peter Eisentraut)
The content of generated columns are computed from expressions
(including references to other columns in the same table)
rather than being specified by INSERT or
UPDATE commands.
Add a WHERE clause
to COPY FROM to
control which rows are accepted (Surafel Temesgen)
This provides a simple way to filter incoming data.
Allow enumerated values to be added more flexibly
(Andrew Dunstan, Tom Lane, Thomas Munro)
Previously, ALTER TYPE
... ADD VALUE could not be called in a transaction
block, unless it was part of the same transaction that created the
enumerated type. Now it can be called in a later transaction, so
long as the new enumerated value is not referenced until after it is
committed.
Add commands to end a transaction and start a new one (Peter
Eisentraut)
The commands are COMMIT AND
CHAIN
and ROLLBACK AND
CHAIN.
Add and CREATE
TABLE options to prevent VACUUM
from truncating trailing empty pages (Takayuki Tsunakawa)
These options are vacuum_truncate and
toast.vacuum_truncate. Use of these options
reduces VACUUM's locking requirements, but
prevents returning disk space to the operating system.
Allow VACUUM to skip index cleanup
(Masahiko Sawada)
This change adds a VACUUM command
option INDEX_CLEANUP as well as a table storage
option vacuum_index_cleanup. Use of this option
reduces the ability to reclaim space and can lead to index bloat,
but it is helpful when the main goal is to freeze old tuples.
Add the ability to skip VACUUM and
ANALYZE operations on tables that cannot be
locked immediately (Nathan Bossart)
This option is called SKIP_LOCKED.
Allow VACUUM and ANALYZE
to take optional Boolean argument specifications (Masahiko Sawada)
Prevent ,
VACUUM and ANALYZE
from requesting a lock on
tables for which the user lacks permission (Michaël Paquier)
This prevents unauthorized locking, which could interfere with
user queries.
Add option
SETTINGS to output non-default optimizer
settings (Tomas Vondra)
This output can also be obtained when using
by setting auto_explain.log_settings.
Add OR REPLACE option to
(Andrew Gierth)
Allow modifications of system catalogs' options using (Peter Eisentraut)
Modifications of catalogs' reloptions and
autovacuum settings are now supported. (Setting is still required.)
Use all key columns' names when selecting default constraint
names for foreign keys (Peter Eisentraut)
Previously, only the first column name was included in the constraint
name, resulting in ambiguity for multi-column foreign keys.
Data Types
Update assorted knowledge about Unicode to match Unicode 12.1.0
(Peter Eisentraut)
This fixes, for example, cases
where psql would misformat output
involving combining characters.
Update Snowball stemmer dictionaries with support for new languages
(Arthur Zakirov)
This adds word stemming support for Arabic, Indonesian, Irish,
Lithuanian, Nepali, and Tamil to full
text search.
Allow creation of collations that report
string equality for strings that are not bit-wise equal (Peter
Eisentraut)
This feature supports nondeterministic collations
that can define case- and accent-agnostic equality comparisons.
Thus, for example, a case-insensitive uniqueness constraint on a
text column can be made more easily than before. This is only
supported for ICU collations.
Add support for ICU collation attributes on older
ICU versions (Peter Eisentraut)
This allows customization of the collation rules in a consistent way
across all ICU versions.
Allow data
type name
to more seamlessly be compared to other text types (Tom Lane)
Type name now behaves much like a domain over
type text that has default collation C.
This allows cross-type comparisons to be processed more efficiently.
Functions
Add support for the SQL/JSON path language
(Nikita Glukhov, Teodor Sigaev, Alexander Korotkov, Oleg Bartunov,
Liudmila Mantrova)
This allows execution of complex queries on JSON
values using an SQL-standard language.
Add support for hyperbolic
functions (Lætitia Avrot)
Also add log10() as an alias for
log(), for standards compliance.
Improve the accuracy of statistical aggregates like variance()
by using more precise algorithms (Dean Rasheed)
Allow date_trunc()
to have an additional argument to control the time zone (Vik
Fearing, Tom Lane)
This is faster and simpler than using the AT TIME
ZONE clause.
Adjust to_timestamp()/to_date()
functions to be more forgiving of template mismatches (Artur
Zakirov, Alexander Korotkov, Liudmila Mantrova)
This new behavior more closely matches the
Oracle functions of the same name.
Fix assorted bugs in XML functions
(Pavel Stehule, Markus Winand, Chapman Flack)
Specifically, in XMLTABLE,
xpath(), and xmlexists(),
fix some cases where nothing was output for a node, or an
unexpected error was thrown, or necessary escaping of XML special
characters was omitted.
Allow the BY VALUE clause
in XMLEXISTS and XMLTABLE
(Chapman Flack)
This SQL-standard clause has no effect
in PostgreSQL's implementation, but it
was unnecessarily being rejected.
Prevent current_schema()
and current_schemas() from being run by
parallel workers, as they are not parallel-safe (Michaël Paquier)
Allow RECORD and RECORD[] to be used
as column types in a query's column definition list for a table function that is declared
to return RECORD (Elvis Pranskevichus)
PL/pgSQL
Allow SQL commands and variables with the same names as those
commands to be used in the same PL/pgSQL function (Tom Lane)
For example, allow a variable called comment to
exist in a function that calls
the COMMENT SQL command.
Previously this combination caused a parse error.
Add new optional warning and error checks to PL/pgSQL (Pavel
Stehule)
The new checks allow for run-time validation of
INTO column counts and single-row results.
Client Interfaces
Add connection parameter
to control libpq's TCP
timeout (Ryohei Nagaura)
Allow libpq (and thus
psql) to report only the
SQLSTATE value in error messages (Didier Gautheron)
Add libpq
function PQresultMemorySize()
to report the memory used by a query result (Lars Kanis, Tom Lane)
Remove the no-display/debug flag from libpq's
options connection parameter (Peter Eisentraut)
This allows this parameter to be set by
postgres_fdw.
Allow to create variables of data type
bytea (Ryo Matsumura)
This allows ECPG clients to interact with bytea data
directly, rather than using an encoded form.
Add PREPARE AS support to
ECPG (Ryo Matsumura)
Client Applications
Allow to select tables for vacuum
based on their wraparound horizon (Nathan Bossart)
The options are and
.
Allow vacuumdb to disable waiting for locks
or skipping all-visible pages (Nathan Bossart)
The options are and
.
Add colorization to the output of command-line utilities (Peter
Eisentraut)
This is enabled by setting the environment variable
PG_COLOR to always
or auto. The specific colors used can be
adjusted by setting the environment variable
PG_COLORS, using ANSI escape codes for colors.
For example, the default behavior is equivalent to
PG_COLORS="error=01;31:warning=01;35:locus=01".
Add CSV table output mode in
psql (Daniel Vérité)
This is controlled by \pset format csv or the
command-line option.
Show the manual page URL in
psql's \help output
for a SQL command (Peter Eisentraut)
Display the IP address in
psql's \conninfo
(Fabien Coelho)
Improve tab completion of CREATE TABLE,
CREATE TRIGGER,
CREATE EVENT TRIGGER,
ANALYZE, EXPLAIN,
VACUUM, ALTER TABLE,
ALTER INDEX, ALTER DATABASE,
and ALTER INDEX ALTER COLUMN
(Dagfinn Ilmari Mannsåker, Tatsuro Yamada, Michaël Paquier,
Tom Lane, Justin Pryzby)
pgbench
Allow values produced by queries to be assigned
to pgbench variables (Fabien Coelho,
Álvaro Herrera)
The command for this is \gset.
Improve precision of pgbench's
option (Tom Lane)
Improve pgbench's error reporting with
clearer messages and return codes (Peter Eisentraut)
Server Applications
Allow control of log file rotation via
(Kyotaro Horiguchi, Alexander Kuzmenkov, Alexander Korotkov)
Previously, this was only possible via an SQL
function or a process signal.
Properly detach the new server process
during pg_ctl start
(Paul Guo)
This prevents the server from being shut down if the shell script
that invoked pg_ctl is interrupted later.
Allow to use the file system's cloning
feature, if there is one (Peter Eisentraut)
The option has the advantages of
, while preventing the old cluster from
being changed after the new cluster has started.
Allow specification of the socket directory to use
in pg_upgrade (Daniel Gustafsson)
This is controlled by ; the default
is the current directory.
Allow to disable fsync operations
(Michaël Paquier)
This is controlled by the option.
Allow to disable fsync operations
(Michaël Paquier)
Fix to report accurate
open_datasync durations on
Windows (Laurenz Albe)
pg_dump,
pg_dumpall,
pg_restore
When pg_dump emits data
with INSERT commands rather
than COPY, allow more than one data row to be
included in each INSERT (Surafel Temesgen,
David Rowley)
The option controlling this is .
Allow pg_dump to emit INSERT
... ON CONFLICT DO NOTHING (Surafel Temesgen)
This avoids conflict failures during restore.
The option is .
Decouple the order of operations in a
parallel pg_dump from the order used by
a subsequent parallel pg_restore (Tom
Lane)
This allows pg_restore to perform
more-fully-parallelized parallel restores, especially in cases
where the original dump was not done in parallel. Scheduling of a
parallel pg_dump is also somewhat
improved.
Allow the setting to be
specified for pg_dump and
pg_dumpall (Andrew Dunstan)
This is primarily useful for making dumps that are exactly
comparable across different source server versions. It is not
recommended for normal use, as it may result in loss of precision
when the dump is restored.
Add option to
pg_dumpall (Andrew Dunstan)
Source Code
Add command to create
new table types (Andres Freund, Haribabu Kommi, Álvaro Herrera,
Alexander Korotkov, Dmitry Dolgov)
This enables the development of new table
access methods, which can optimize storage for different
use cases. The existing heap access method
remains the default.
Add planner support
function interfaces to improve optimizer estimates,
inlining, and indexing for functions (Tom Lane)
This allows extensions to create planner support functions that
can provide function-specific selectivity, cost, and row-count
estimates that can depend on the function's arguments. Support
functions can also supply simplified representations and index
conditions, greatly expanding optimization possibilities.
Simplify renumbering manually-assigned OIDs, and establish a new
project policy for management of such OIDs (John Naylor, Tom Lane)
Patches that manually assign OIDs for new built-in objects (such as
new functions) should now randomly choose OIDs in the range
8000—9999. At the end of a development cycle, the OIDs used
by committed patches will be renumbered down to lower numbers,
currently somewhere in the 4xxx range,
using the new renumber_oids.pl
script. This approach should greatly reduce the odds of OID
collisions between different in-process patches.
While there is no specific policy reserving any OIDs for external
use, it is recommended that forks and other projects needing
private manually-assigned OIDs use numbers in the high
7xxx range. This will avoid conflicts
with recently-merged patches, and it should be a long time before
the core project reaches that range.
Build Cygwin binaries using dynamic
instead of static libraries (Marco Atzeri)
Remove configure switch
(Michaël Paquier)
A strong random-number source is now required.
printf-family functions, as well
as strerror
and strerror_r, now behave uniformly across
platforms within Postgres code (Tom Lane)
Notably, printf
understands %m everywhere; on
Windows, strerror copes with Winsock error
codes (it used to do so in backend but not frontend code);
and strerror_r always follows the GNU return
convention.
Require a C99-compliant compiler, and MSVC
2013 or later on Windows (Andres Freund)
Use pandoc,
not lynx, for generating plain-text
documentation output files (Peter Eisentraut)
This affects only the INSTALL file generated
during make dist and the seldom-used
plain-text postgres.txt output file.
Pandoc produces better output than lynx and avoids some
locale/encoding issues. Pandoc version 1.13 or later is required.
Support use of images in the PostgreSQL
documentation (Jürgen Purtz)
Additional Modules
Allow ORDER BY sorts
and LIMIT clauses to be pushed
to foreign servers in more
cases (Etsuro Fujita)
Improve optimizer cost accounting for
postgres_fdw queries (Etsuro Fujita)
Properly honor WITH CHECK OPTION on views
that reference postgres_fdw tables
(Etsuro Fujita)
While CHECK OPTIONs on
postgres_fdw tables are ignored (because
the reference is foreign), views on such tables are considered
local, so this change enforces CHECK OPTIONs
on them. Previously, only INSERTs and
UPDATEs with RETURNING
clauses that returned CHECK OPTION values
were validated.
Allow pg_stat_statements_reset()
to be more granular (Haribabu Kommi, Amit Kapila)
The function now allows reset of statistics for specific databases,
users, and queries.
Allow control of the log level
(Tom Dunstan, Andrew Dunstan)
The default is LOG.
Update rules with new
punctuation and symbols (Hugh Ranalli, Michaël Paquier)
Allow unaccent to handle some accents
encoded as combining characters (Hugh Ranalli)
Allow unaccent to remove accents from
Greek characters (Tasos Maschalidis)
Add a parameter to
's bt_index_parent_check()
function to check each index tuple from the root of the tree
(Peter Geoghegan)
Improve and
option handling to match other commands (Tatsuro Yamada)
Acknowledgments
The following individuals (in alphabetical order) have contributed to this
release as patch authors, committers, reviewers, testers, or reporters of
issues.
Abhijit Menon-SenAchilleas MantziosAdam BerlinAdam BielanskiAditya ToshniwalAdrien NayratAlan JacksonAlbert SchabhuetlAleksander AlekseevAlex AktsipetrovAlex KliukinAlex MacyAlexander KorotkovAlexander KukushkinAlexander KuzmenkovAlexander LakhinAlexandra RyzhevichAlexey BashtanovAlexey ErmakovAlexey KondratovAlexey KryuchkovAlexey StepanovAllison KapturÁlvaro HerreraAlyssa RossAmit KapilaAmit KhandekarAmit LangoteAmul SulAnastasia LubennikovaAndré HänselAndrea GelminiAndreas Joseph KroghAndreas KarlssonAndreas KunertAndreas ScherbaumAndreas SeltenreichAndrei YahorauAndres FreundAndrew DunstanAndrew FletcherAndrew GierthAndrew KrasichkovAndrey BorodinAndrey KlychkovAndrey LepikhovAndy AbelistoAnthony GreeneAnthony SkorskiAntonin HouskaArne RolandArseny SherArthur ZakirovAsh MarathAshutosh BapatAshutosh SharmaAshwin AgrawalAya IwataBartosz PolnikBasil BourqueBernd HelmleBrad DeJongBrigitte Blanc-LafayBruce KleinBruce MomjianBruno WolffChapman FlackChen HuajunChris TraversChris WilsonChristian HofstaedtlerChristoph BergChristoph Moench-TegederClemens LadischColm McHughCorey HuinkerCraig RingerDagfinn Ilmari MannsåkerDaisuke HiguchiDaniel FioriDaniel GustafssonDaniel VéritéDaniel WestermannDaniel WilchesDarafei PraliaskouskiDaryl WaycottDave CramerDavid BindermanDavid FetterDavid G. JohnstonDavid RowleyDavid SteeleDavy MachadoDean RasheedDerek HansDerek NelsonDevrim GündüzDian FayDidier GautheronDilip KumarDmitry DolgovDmitry MarakasovDmitry MolotkovDmitry ShalashovDon SeilerDonald DongDoug RadyEdmund HornerEduards BezverhijsElvis PranskevichusEmanuel AraújoEmre HasegeliEric CyrErik RijkersErtugrul KahveciEtsuro FujitaEugen KonkovEuler TaveiraFabien CoelhoFabrízio de Royes MelloFeike SteenbergenFilip RembialkowskiGaby SchildersGeert LobbestaelGeorge TarasovGeorgios KokolatosGianni CiolliGilles DaroldGreg StarkGrigory SmolkinGuillaume LelargeGunnlaugur Thor BriemGurjeet SinghHadi MoshayediHailong LiHans BuschmannHaribabu KommiHaruka TakatsukaHayato KurodaHeikki LinnakangasHironobu SuzukiHubert LubaczewskiHugh RanalliIan BarwickIbrar AhmedIldar MusinInsung MoonIoseph KimIsaac MorlandIvan PanchenkoJack KellyJacob ChampionJaime CasanovaJakob EggerJakub GlapaJakub JanecekJames ColemanJames InformJames RobinsonJames SewellJames TomsonJan ChocholJaroslav SivyJean-Christophe ArnuJean-Marc VoillequinJean-Pierre PelletierJeevan ChalkeJeevan LadheJeff DavisJeff JanesJeremy EvansJeremy SchneiderJeremy SmithJerry JelinekJesper PedersenJianing YangJie ZhangJim NasbyJimmy YihJoe ConwayJoe WildishJoerg SonnenbergerJohn KlannJohn NaylorJonah HarrisJonathan S. KatzJorge Gustavo RochaJosé Arthur Benetasso VillanovaJoshua D. DrakeJuan José Santamaría FlechaJulian HsiaoJulian MarkwortJulian SchauderJulien RouhaudJürgen PurtzJürgen StrobelJustin PryzbyKaiting ChenKaren HuddlestonKarl CzajkowskiKarl O. PincKeiichi HirobeKeith FiskeKen TanzerKenji UnoKevin GrittnerKevin Hale BoyesKieran McCuskerKirk JamisonKohei KaiGaiKonstantin KnizhnikKonstantin KuznetsovKristjan TammekiviKuntal GhoshKyle SamsonKyotaro HoriguchiLætitia AvrotLars KanisLaurenz AlbeLim MyungkyuLiu HuailingLiudmila MantrovaLloyd AlbinLuca FerrariLuis M. CarrilLukas EderLukas FittlMadelaine ThibautMadeleine ThompsonMagnus HaganderMahendra SinghMai PengMaksim MilyutinMaksym BogukMalthe BorchManuel RiggerMarco AtzeriMarco SlotMarina PolyakovaMario De Frutos DieguezMarius TimmerMark ChambersMark DilgerMarko TiikkajaMarkus WinandMartín MarquésMasahiko SawadaMasao FujiiMateusz GuzikMathias BrossardMatt WilliamsMatthias OtterbachMatvey AryeMelanie PlagemanMi TarMichael BanckMichael DavidsonMichael MeskesMichael PaquierMichael VitaleMichel PelletierMikalai KeidaMike PalmiottoMithun CyMorgan OwensMurat KabilovNathan BossartNawaz AhmedNeeraj KumarNick BarnesNico WilliamsNikita GlukhovNikolay ShaplovNing YuNishant FnuNoah MischNorbert BenkocsNoriyoshi ShinodaOleg BartunovOleg SamoilovOleksii KliukinOndrej BoudaOskari SaarenmaaPan BianPatrick FrancellePatrick McHardyPaul A. JungwirthPaul BonaudPaul GuoPaul MartinezPaul RamseyPaul SchaapPaul van der LindenPavan DeolaseePavel OskinPavel RaiskupPavel StehulePeifeng QiuPeter BillenPeter EisentrautPeter GeogheganPeter NeavePetr FedorovPetr JelínekPetr SlavovPetru-Florin MihanceaPhil BayerPhil FlorentPhilip DubéPierre DucroquetPiotr Gabriel KosinskiPiotr StefaniakPiotr WlodarczykPrabhat SahuQuentin RameauRafael CastroRafia SabihRahila SyedRajkumar RaghuwanshiRares SalcudeanRaúl Marín RodríguezRegina ObeRenaud NavarroRichard GuoRick OttenRikard FalkebornRK KorlapatiRobbie HarwoodRobert HaasRobert TreatRobert VollmertRoger CurleyRoman ZharkovRonan DunklauRui Hai JiangRushabh LathiaRyan LambertRyo MatsumuraRyohei NagauraRyohei TakahashiSamuel WilliamsSand StoneSanyo CapobiangoSatoru KoizumiSean JohnstonSerge LatyntsevSergei KornilovSergey PashkovSergio Conde GómezShawn DebnathShay RojanskySho KatoShohei MochizukiShouyu LuoSimon RiggsSivasubramanian RamasubramanianSlawomir ChodnickiStas KelvishStefan KadowStepan YankevychStephen AmellStephen FrostSteve RogersonSteve SingerSteven WinfieldSurafel TemesgenSuraj KharageSuresh Kumar RTakayuki TsunakawaTakeshi IderihaTakuma HoshiaiTasos MaschalidisTatsuo IshiiTatsuro YamadaTeodor SigaevThom BrownThomas MunroThomas PotyTillmann SchulzTim MöhlmannTimur BirshTobias BussmannTom CassidyTom DunstanTom GottfriedTom LaneTomas VondraTushar AhujaUlf AdamsVaishnavi PrabakaranVictor PetrovykhVictor WagnerVictor YegorovVijaykumar JainVik FearingVlad SterzhanovVladimir BaranoffVladimir KriukovWu FeiYaroslav SchekinYi HuangYoshikazu ImaiYugo NagataYulian KhodorkovskiyYuming WangYunQiang SuYuri KurenkovYusuke EgashiraYuzuko HosoyaZhou Digoal