Jump to:
Avoid access to already-freed memory during partition routing error reports (Michael Paquier)
This mistake could lead to a crash, and in principle it might be possible to use it to disclose server memory contents. (CVE-2019-10129)
Fix execution of hashed subplans that require cross-type comparison (Tom Lane, Andreas Seltenreich)
Hashed subplans used the outer query's original comparison operator to compare entries of the hash table. This is the wrong thing if that operator is cross-type, since all the hash table entries will be of the subquery's output type. For the set of hashable cross-type operators in core PostgreSQL, this mistake seems nearly harmless on 64-bit machines, but it can result in crashes or perhaps unauthorized disclosure of server memory on 32-bit machines. Extensions might provide hashable cross-type operators that create larger risks. (CVE-2019-10209)
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 information leakage in constraint-violation error messages (Heikki Linnakangas)
If an UPDATE
command attempts to move a row to a different partition but finds that it violates some constraint on the new partition, and the columns in that partition are in different physical positions than in the parent table, the error message could reveal the contents of columns that the user does not have SELECT
privilege on. (CVE-2021-3393)
Fix possibly-incorrect computation of UPDATE ... RETURNING
outputs for joined cross-partition updates (Amit Langote, Etsuro Fujita)
If an UPDATE
for a partitioned table caused a row to be moved to another partition with a physically different row type (for example, one with a different set of dropped columns), computation of RETURNING
results for that row could produce errors or wrong answers. No error is observed unless the UPDATE
involves other tables being joined to the target table. (CVE-2021-32029)
Config parameter: | Default value: |
---|---|
default_with_oids | off |
replacement_sort_tuples | 150000 |
Config parameter: | Default value in Pg 10.17: | Default value in Pg 12.7: |
---|---|---|
autovacuum_vacuum_cost_delay | 20 | 2 |
extra_float_digits | 0 | 1 |
wal_segment_size | 2048 | 16777216 |
⇑ Upgrade to 11 released on 2018-10-18 - docs
Make pg_dump dump the properties of a database, not just its contents (Haribabu Kommi)
Previously, attributes of the database itself, such as database-level GRANT
/REVOKE
permissions and ALTER DATABASE SET
variable settings, were only dumped by pg_dumpall. Now pg_dump --create
and pg_restore --create
will restore these database properties in addition to the objects within the database. pg_dumpall -g
now only dumps role- and tablespace-related attributes. pg_dumpall's complete output (without -g
) is unchanged.
pg_dump and pg_restore, without --create
, no longer dump/restore database-level comments and security labels; those are now treated as properties of the database.
pg_dumpall's output script will now always create databases with their original locale and encoding, and hence will fail if the locale or encoding name is unknown to the destination system. Previously, CREATE DATABASE
would be emitted without these specifications if the database locale and encoding matched the old cluster's defaults.
pg_dumpall --clean
now restores the original locale and encoding settings of the postgres
and template1
databases, as well as those of user-created databases.
Consider syntactic form when disambiguating function versus column references (Tom Lane)
When x
is a table name or composite column, PostgreSQL has traditionally considered the syntactic forms
and f
(x
)
to be equivalent, allowing tricks such as writing a function and then using it as though it were a computed-on-demand column. However, if both interpretations are feasible, the column interpretation was always chosen, leading to surprising results if the user intended the function interpretation. Now, if there is ambiguity, the interpretation that matches the syntactic form is chosen.x
.f
Fully enforce uniqueness of table and domain constraint names (Tom Lane)
PostgreSQL expects the names of a table's constraints to be distinct, and likewise for the names of a domain's constraints. However, there was not rigid enforcement of this, and previously there were corner cases where duplicate names could be created.
Make power(numeric, numeric)
and power(float8, float8)
handle NaN
inputs according to the POSIX standard (Tom Lane, Dang Minh Huong)
POSIX says that NaN ^ 0 = 1
and 1 ^ NaN = 1
, but all other cases with NaN
input(s) should return NaN
. power(numeric, numeric)
just returned NaN
in all such cases; now it honors the two exceptions. power(float8, float8)
followed the standard if the C library does; but on some old Unix platforms the library doesn't, and there were also problems on some versions of Windows.
Prevent to_number()
from consuming characters when the template separator does not match (Oliver Ford)
Specifically, SELECT to_number('1234', '9,999')
used to return 134
. It will now return 1234
. L
and TH
now only consume characters that are not digits, positive/negative signs, decimal points, or commas.
Fix to_date()
, to_number()
, and to_timestamp()
to skip a character for each template character (Tom Lane)
Previously, they skipped one byte for each byte of template character, resulting in strange behavior if either string contained multibyte characters.
Adjust the handling of backslashes inside double-quotes in template strings for to_char()
, to_number()
, and to_timestamp()
.
Such a backslash now escapes the character after it, particularly a double-quote or another backslash.
Correctly handle relative path expressions in xmltable()
, xpath()
, and other XML-handling functions (Markus Winand)
Per the SQL standard, relative paths start from the document node of the XML input document, not the root node as these functions previously did.
In the extended query protocol, make statement_timeout
apply to each Execute message separately, not to all commands before Sync (Tatsuo Ishii, Andres Freund)
Remove the relhaspkey
column from system catalog pg_class
(Peter Eisentraut)
Applications needing to check for a primary key should consult pg_index
.
Replace system catalog pg_proc
's proisagg
and proiswindow
columns with prokind
(Peter Eisentraut)
This new column more clearly distinguishes functions, procedures, aggregates, and window functions.
Correct information schema column tables
.table_type
to return FOREIGN
instead of FOREIGN TABLE
(Peter Eisentraut)
This new output matches the SQL standard.
Change the ps process display labels for background workers to match the pg_stat_activity
.backend_type
labels (Peter Eisentraut)
Cause large object permission checks to happen during large object open, lo_open()
, not when a read or write is attempted (Tom Lane, Michael Paquier)
If write access is requested and not available, an error will now be thrown even if the large object is never written to.
Prevent non-superusers from reindexing shared catalogs (Michael Paquier, Robert Haas)
Previously, database owners were also allowed to do this, but now it is considered outside the bounds of their privileges.
Remove deprecated adminpack
functions pg_file_read()
, pg_file_length()
, and pg_logfile_rotate()
(Stephen Frost)
Equivalent functionality is now present in the core backend. Existing adminpack
installs will continue to have access to these functions until they are updated via ALTER EXTENSION ... UPDATE
.
Honor the capitalization of double-quoted command options (Daniel Gustafsson)
Previously, option names in certain SQL commands were forcibly lower-cased even if entered with double quotes; thus for example "FillFactor"
would be accepted as an index storage option, though properly its name is lower-case. Such cases will now generate an error.
Remove server parameter replacement_sort_tuples
(Peter Geoghegan)
Replacement sorts were determined to be no longer useful.
Remove WITH
clause in CREATE FUNCTION
(Michael Paquier)
PostgreSQL has long supported a more standard-compliant syntax for this capability.
In PL/pgSQL trigger functions, the OLD
and NEW
variables now read as NULL when not assigned (Tom Lane)
Previously, references to these variables could be parsed but not executed.
Allow the creation of partitions based on hashing a key column (Amul Sul)
Support indexes on partitioned tables (Álvaro Herrera, Amit Langote)
An “index” on a partitioned table is not a physical index across the whole partitioned table, but rather a template for automatically creating similar indexes on each partition of the table.
If the partition key is part of the index's column set, a partitioned index may be declared UNIQUE
. It will represent a valid uniqueness constraint across the whole partitioned table, even though each physical index only enforces uniqueness within its own partition.
The new command ALTER INDEX ATTACH PARTITION
causes an existing index on a partition to be associated with a matching index template for its partitioned table. This provides flexibility in setting up a new partitioned index for an existing partitioned table.
Allow foreign keys on partitioned tables (Álvaro Herrera)
Allow FOR EACH ROW
triggers on partitioned tables (Álvaro Herrera)
Creation of a trigger on a partitioned table automatically creates triggers on all existing and future partitions. This also allows deferred unique constraints on partitioned tables.
Allow partitioned tables to have a default partition (Jeevan Ladhe, Beena Emerson, Ashutosh Bapat, Rahila Syed, Robert Haas)
The default partition will store rows that don't match any of the other defined partitions, and is searched accordingly.
UPDATE
statements that change a partition key column now cause affected rows to be moved to the appropriate partitions (Amit Khandekar)
Allow INSERT
, UPDATE
, and COPY
on partitioned tables to properly route rows to foreign partitions (Etsuro Fujita, Amit Langote)
This is supported by postgres_fdw
foreign tables. Since the ExecForeignInsert
callback function is called for this in a different way than it used to be, foreign data wrappers must be modified to cope with this change.
Allow faster partition elimination during query processing (Amit Langote, David Rowley, Dilip Kumar)
This speeds access to partitioned tables with many partitions.
Allow partition elimination during query execution (David Rowley, Beena Emerson)
Previously, partition elimination only happened at planning time, meaning many joins and prepared queries could not use partition elimination.
In an equality join between partitioned tables, allow matching partitions to be joined directly (Ashutosh Bapat)
This feature is disabled by default but can be enabled by changing enable_partitionwise_join
.
Allow aggregate functions on partitioned tables to be evaluated separately for each partition, subsequently merging the results (Jeevan Chalke, Ashutosh Bapat, Robert Haas)
This feature is disabled by default but can be enabled by changing enable_partitionwise_aggregate
.
Allow postgres_fdw
to push down aggregates to foreign tables that are partitions (Jeevan Chalke)
Allow parallel building of a btree index (Peter Geoghegan, Rushabh Lathia, Heikki Linnakangas)
Allow hash joins to be performed in parallel using a shared hash table (Thomas Munro)
Allow UNION
to run each SELECT
in parallel if the individual SELECT
s cannot be parallelized (Amit Khandekar, Robert Haas, Amul Sul)
Allow partition scans to more efficiently use parallel workers (Amit Khandekar, Robert Haas, Amul Sul)
Allow LIMIT
to be passed to parallel workers (Robert Haas, Tom Lane)
This allows workers to reduce returned results and use targeted index scans.
Allow single-evaluation queries, e.g. WHERE
clause aggregate queries, and functions in the target list to be parallelized (Amit Kapila, Robert Haas)
Add server parameter parallel_leader_participation
to control whether the leader also executes subplans (Thomas Munro)
The default is enabled, meaning the leader will execute subplans.
Allow parallelization of commands CREATE TABLE ... AS
, SELECT INTO
, and CREATE MATERIALIZED VIEW
(Haribabu Kommi)
Improve performance of sequential scans with many parallel workers (David Rowley)
Add reporting of parallel workers' sort activity in EXPLAIN
(Robert Haas, Tom Lane)
Allow B-tree indexes to include columns that are not part of the search key or unique constraint, but are available to be read by index-only scans (Anastasia Lubennikova, Alexander Korotkov, Teodor Sigaev)
This is enabled by the new INCLUDE
clause of CREATE INDEX
. It facilitates building “covering indexes” that optimize specific types of queries. Columns can be included even if their data types don't have B-tree support.
Improve performance of monotonically increasing index additions (Pavan Deolasee, Peter Geoghegan)
Improve performance of hash index scans (Ashutosh Sharma)
Add predicate locking for hash, GiST and GIN indexes (Shubham Barai)
This reduces the likelihood of serialization conflicts in serializable-mode transactions.
Add prefix-match operator text
^@
text
, which is supported by SP-GiST (Ildus Kurbangaliev)
This is similar to using var
LIKE 'word%'
with a btree index, but it is more efficient.
Allow polygons to be indexed with SP-GiST (Nikita Glukhov, Alexander Korotkov)
Allow SP-GiST to use lossy representation of leaf keys (Teodor Sigaev, Heikki Linnakangas, Alexander Korotkov, Nikita Glukhov)
Improve selection of the most common values for statistics (Jeff Janes, Dean Rasheed)
Previously, the most common values (MCVs) were identified based on their frequency compared to all column values. Now, MCVs are chosen based on their frequency compared to the non-MCV values. This improves the robustness of the algorithm for both uniform and non-uniform distributions.
Improve selectivity estimates for >=
and <=
(Tom Lane)
Previously, such cases used the same selectivity estimates as >
and <
, respectively, unless the comparison constants are MCVs. This change is particularly helpful for queries involving BETWEEN
with small ranges.
Reduce var
=
var
to var
IS NOT NULL
where equivalent (Tom Lane)
This leads to better selectivity estimates.
Improve optimizer's row count estimates for EXISTS
and NOT EXISTS
queries (Tom Lane)
Make the optimizer account for evaluation costs and selectivity of HAVING
clauses (Tom Lane)
Add Just-in-Time (JIT) compilation of some parts of query plans to improve execution speed (Andres Freund)
This feature requires LLVM to be available. It is not currently enabled by default, even in builds that support it.
Allow bitmap scans to perform index-only scans when possible (Alexander Kuzmenkov)
Update the free space map during VACUUM
(Claudio Freire)
This allows free space to be reused more quickly.
Allow VACUUM
to avoid unnecessary index scans (Masahiko Sawada, Alexander Korotkov)
Improve performance of committing multiple concurrent transactions (Amit Kapila)
Reduce memory usage for queries using set-returning functions in their target lists (Andres Freund)
Improve the speed of aggregate computations (Andres Freund)
Allow postgres_fdw
to push UPDATE
s and DELETE
s using joins to foreign servers (Etsuro Fujita)
Previously, only non-join UPDATE
s and DELETE
s were pushed.
Add support for large pages on Windows (Takayuki Tsunakawa, Thomas Munro)
This is controlled by the huge_pages configuration parameter.
Show memory usage in output from log_statement_stats
, log_parser_stats
, log_planner_stats
, and log_executor_stats
(Justin Pryzby, Peter Eisentraut)
Add column pg_stat_activity
.backend_type
to show the type of a background worker (Peter Eisentraut)
The type is also visible in ps output.
Make log_autovacuum_min_duration
log skipped tables that are concurrently being dropped (Nathan Bossart)
Add information_schema
columns related to table constraints and triggers (Peter Eisentraut)
Specifically, triggers
.action_order
, triggers
.action_reference_old_table
, and triggers
.action_reference_new_table
are now populated, where before they were always null. Also, table_constraints
.enforced
now exists but is not yet usefully populated.
Allow the server to specify more complex LDAP specifications in search+bind mode (Thomas Munro)
Specifically, ldapsearchfilter
allows pattern matching using combinations of LDAP attributes.
Allow LDAP authentication to use encrypted LDAP (Thomas Munro)
We already supported LDAP over TLS by using ldaptls=1
. This new TLS LDAP method for encrypted LDAP is enabled with ldapscheme=ldaps
or ldapurl=ldaps://
.
Improve logging of LDAP errors (Thomas Munro)
Add default roles that enable file system access (Stephen Frost)
Specifically, the new roles are: pg_read_server_files
, pg_write_server_files
, and pg_execute_server_program
. These roles now also control who can use server-side COPY
and the file_fdw
extension. Previously, only superusers could use these functions, and that is still the default behavior.
Allow access to file system functions to be controlled by GRANT
/REVOKE
permissions, rather than superuser checks (Stephen Frost)
Specifically, these functions were modified: pg_ls_dir()
, pg_read_file()
, pg_read_binary_file()
, pg_stat_file()
.
Use GRANT
/REVOKE
to control access to lo_import()
and lo_export()
(Michael Paquier, Tom Lane)
Previously, only superusers were granted access to these functions.
The compile-time option ALLOW_DANGEROUS_LO_FUNCTIONS
has been removed.
Use view owner not session owner when preventing non-password access to postgres_fdw
tables (Robert Haas)
PostgreSQL only allows superusers to access postgres_fdw
tables without passwords, e.g. via peer
. Previously, the session owner had to be a superuser to allow such access; now the view owner is checked instead.
Fix invalid locking permission check in SELECT FOR UPDATE
on views (Tom Lane)
Add server setting ssl_passphrase_command
to allow supplying of the passphrase for SSL key files (Peter Eisentraut)
Also add ssl_passphrase_command_supports_reload
to specify whether the SSL configuration should be reloaded and ssl_passphrase_command
called during a server configuration reload.
Add storage parameter toast_tuple_target
to control the minimum tuple length before TOAST storage will be considered (Simon Riggs)
The default TOAST threshold has not been changed.
Allow server options related to memory and file sizes to be specified in units of bytes (Beena Emerson)
The new unit suffix is “B”. This is in addition to the existing units “kB”, “MB”, “GB” and “TB”.
Allow the WAL file size to be set during initdb (Beena Emerson)
Previously, the 16MB default could only be changed at compile time.
Retain WAL data for only a single checkpoint (Simon Riggs)
Previously, WAL was retained for two checkpoints.
Fill the unused portion of force-switched WAL segment files with zeros for improved compressibility (Chapman Flack)
Replicate TRUNCATE
activity when using logical replication (Simon Riggs, Marco Nenciarini, Peter Eisentraut)
Pass prepared transaction information to logical replication subscribers (Nikhil Sontakke, Stas Kelvich)
Exclude unlogged tables, temporary tables, and pg_internal.init
files from streaming base backups (David Steele)
There is no need to copy such files.
Allow checksums of heap pages to be verified during streaming base backup (Michael Banck)
Allow replication slots to be advanced programmatically, rather than be consumed by subscribers (Petr Jelinek)
This allows efficient advancement of replication slots when the contents do not need to be consumed. This is performed by pg_replication_slot_advance()
.
Add timeline information to the backup_label
file (Michael Paquier)
Also add a check that the WAL timeline matches the backup_label
file's timeline.
Add host and port connection information to the pg_stat_wal_receiver
system view (Haribabu Kommi)
Allow ALTER TABLE
to add a column with a non-null default without doing a table rewrite (Andrew Dunstan, Serge Rielau)
This is enabled when the default value is a constant.
Allow views to be locked by locking the underlying tables (Yugo Nagata)
Allow ALTER INDEX
to set statistics-gathering targets for expression indexes (Alexander Korotkov, Adrien Nayrat)
In psql, \d+
now shows the statistics target for indexes.
Allow multiple tables to be specified in one VACUUM
or ANALYZE
command (Nathan Bossart)
Also, if any table mentioned in VACUUM
uses a column list, then the ANALYZE
keyword must be supplied; previously, ANALYZE
was implied in such cases.
Add parenthesized options syntax to ANALYZE
(Nathan Bossart)
This is similar to the syntax supported by VACUUM
.
Add CREATE AGGREGATE
option to specify the behavior of the aggregate's finalization function (Tom Lane)
This is helpful for allowing user-defined aggregate functions to be optimized and to work as window functions.
Allow the creation of arrays of domains (Tom Lane)
This also allows array_agg()
to be used on domains.
Support domains over composite types (Tom Lane)
Also allow PL/Perl, PL/Python, and PL/Tcl to handle composite-domain function arguments and results. Also improve PL/Python domain handling.
Add casts from JSONB
scalars to numeric and boolean data types (Anastasia Lubennikova)
Add all window function framing options specified by SQL:2011 (Oliver Ford, Tom Lane)
Specifically, allow RANGE
mode to use PRECEDING
and FOLLOWING
to select rows having grouping values within plus or minus the specified offset. Add GROUPS
mode to include plus or minus the number of peer groups. Frame exclusion syntax was also added.
Add SHA-2 family of hash functions (Peter Eisentraut)
Specifically, sha224()
, sha256()
, sha384()
, sha512()
were added.
Add support for 64-bit non-cryptographic hash functions (Robert Haas, Amul Sul)
Allow to_char()
and to_timestamp()
to specify the time zone's offset from UTC in hours and minutes (Nikita Glukhov, Andrew Dunstan)
This is done with format specifications TZH
and TZM
.
Add text search function websearch_to_tsquery()
that supports a query syntax similar to that used by web search engines (Victor Drobny, Dmitry Ivanov)
Add functions json(b)_to_tsvector()
to create a text search query for matching JSON
/JSONB
values (Dmitry Dolgov)
Add SQL-level procedures, which can start and commit their own transactions (Peter Eisentraut)
They are created with the new CREATE PROCEDURE
command and invoked via CALL
.
The new ALTER
/DROP ROUTINE
commands allow altering/dropping of all routine-like objects, including procedures, functions, and aggregates.
Also, writing FUNCTION
is now preferred over writing PROCEDURE
in CREATE OPERATOR
and CREATE TRIGGER
, because the referenced object must be a function not a procedure. However, the old syntax is still accepted for compatibility.
Add transaction control to PL/pgSQL, PL/Perl, PL/Python, PL/Tcl, and SPI server-side languages (Peter Eisentraut)
Transaction control is only available within top-transaction-level procedures and nested DO
and CALL
blocks that only contain other DO
and CALL
blocks.
Add the ability to define PL/pgSQL composite-type variables as not null, constant, or with initial values (Tom Lane)
Allow PL/pgSQL to handle changes to composite types (e.g. record, row) that happen between the first and later function executions in the same session (Tom Lane)
Previously, such circumstances generated errors.
Add extension jsonb_plpython
to transform JSONB
to/from PL/Python types (Anthony Bykov)
Add extension jsonb_plperl
to transform JSONB
to/from PL/Perl types (Anthony Bykov)
Change libpq to disable compression by default (Peter Eisentraut)
Compression is already disabled in modern OpenSSL versions, so that the libpq setting had no effect with such libraries.
Add DO CONTINUE
option to ecpg's WHENEVER
statement (Vinayak Pokale)
This generates a C continue
statement, causing a return to the top of the contained loop when the specified condition occurs.
Add an ecpg mode to enable Oracle Pro*C-style handling of char arrays.
This mode is enabled with -C
.
Add psql command \gdesc
to display the names and types of the columns in a query result (Pavel Stehule)
Add psql variables to report query activity and errors (Fabien Coelho)
Specifically, the new variables are ERROR
, SQLSTATE
, ROW_COUNT
, LAST_ERROR_MESSAGE
, and LAST_ERROR_SQLSTATE
.
Allow psql to test for the existence of a variable (Fabien Coelho)
Specifically, the syntax :{?variable_name}
allows a variable's existence to be tested in an \if
statement.
Allow environment variable PSQL_PAGER
to control psql's pager (Pavel Stehule)
This allows psql's default pager to be specified as a separate environment variable from the pager for other applications. PAGER
is still honored if PSQL_PAGER
is not set.
Make psql's \d+
command always show the table's partitioning information (Amit Langote, Ashutosh Bapat)
Previously, partition information would not be displayed for a partitioned table if it had no partitions. Also indicate which partitions are themselves partitioned.
Ensure that psql reports the proper user name when prompting for a password (Tom Lane)
Previously, combinations of -U
and a user name embedded in a URI caused incorrect reporting. Also suppress the user name before the password prompt when --password
is specified.
Allow quit
and exit
to exit psql when given with no prior input (Bruce Momjian)
Also print hints about how to exit when quit
and exit
are used alone on a line while the input buffer is not empty. Add a similar hint for help
.
Make psql hint at using control-D when \q
is entered alone on a line but ignored (Bruce Momjian)
For example, \q
does not exit when supplied in character strings.
Improve tab completion for ALTER INDEX RESET
/SET
(Masahiko Sawada)
Add infrastructure to allow psql to adapt its tab completion queries based on the server version (Tom Lane)
Previously, tab completion queries could fail against older servers.
Add pgbench expression support for NULLs, booleans, and some functions and operators (Fabien Coelho)
Add \if
conditional support to pgbench (Fabien Coelho)
Allow the use of non-ASCII characters in pgbench variable names (Fabien Coelho)
Add pgbench option --init-steps
to control the initialization steps performed (Masahiko Sawada)
Add an approximately Zipfian-distributed random generator to pgbench (Alik Khilazhev)
Allow the random seed to be set in pgbench (Fabien Coelho)
Allow pgbench to do exponentiation with pow()
and power()
(Raúl Marín Rodríguez)
Add hashing functions to pgbench (Ildar Musin)
Make pgbench statistics more accurate when using --latency-limit
and --rate
(Fabien Coelho)
Add an option to pg_basebackup that creates a named replication slot (Michael Banck)
The option --create-slot
creates the named replication slot (--slot
) when the WAL streaming method (--wal-method=stream
) is used.
Allow initdb to set group read access to the data directory (David Steele)
This is accomplished with the new initdb option --allow-group-access
. Administrators can also set group permissions on the empty data directory before running initdb. Server variable data_directory_mode
allows reading of data directory group permissions.
Add pg_verify_checksums tool to verify database checksums while offline (Magnus Hagander)
Allow pg_resetwal to change the WAL segment size via --wal-segsize
(Nathan Bossart)
Add long options to pg_resetwal and pg_controldata (Nathan Bossart, Peter Eisentraut)
Add pg_receivewal option --no-sync
to prevent synchronous WAL writes, for testing (Michael Paquier)
Add pg_receivewal option --endpos
to specify when WAL receiving should stop (Michael Paquier)
Allow pg_ctl to send the SIGKILL
signal to processes (Andres Freund)
This was previously unsupported due to concerns over possible misuse.
Reduce the number of files copied by pg_rewind (Michael Paquier)
Prevent pg_rewind from running as root
(Michael Paquier)
Add pg_dumpall option --encoding
to control output encoding (Michael Paquier)
pg_dump already had this option.
Add pg_dump option --load-via-partition-root
to force loading of data into the partition's root table, rather than the original partition (Rushabh Lathia)
This is useful if the system to be loaded to has different collation definitions or endianness, possibly requiring rows to be stored in different partitions than previously.
Add an option to suppress dumping and restoring database object comments (Robins Tharakan)
The new pg_dump, pg_dumpall, and pg_restore option is --no-comments
.
Add PGXS support for installing include files (Andrew Gierth)
This supports creating extension modules that depend on other modules. Formerly there was no easy way for the dependent module to find the referenced one's include files. Several existing contrib
modules that define data types have been adjusted to install relevant files. Also, PL/Perl and PL/Python now install their include files, to support creation of transform modules for those languages.
Install errcodes.txt
to allow extensions to access the list of error codes known to PostgreSQL (Thomas Munro)
Convert documentation to DocBook XML (Peter Eisentraut, Alexander Lakhin, Jürgen Purtz)
The file names still use an sgml
extension for compatibility with back branches.
Use stdbool.h
to define type bool
on platforms where it's suitable, which is most (Peter Eisentraut)
This eliminates a coding hazard for extension modules that need to include stdbool.h
.
Overhaul the way that initial system catalog contents are defined (John Naylor)
The initial data is now represented in Perl data structures, making it much easier to manipulate mechanically.
Prevent extensions from creating custom server parameters that take a quoted list of values (Tom Lane)
This cannot be supported at present because knowledge of the parameter's property would be required even before the extension is loaded.
Add ability to use channel binding when using SCRAM authentication (Michael Paquier)
Channel binding is intended to prevent man-in-the-middle attacks, but SCRAM cannot prevent them unless it can be forced to be active. Unfortunately, there is no way to do that in libpq. Support for it is expected in future versions of libpq and in interfaces not built using libpq, e.g. JDBC.
Allow background workers to attach to databases that normally disallow connections (Magnus Hagander)
Add support for hardware CRC calculations on ARMv8 (Yuqi Gu, Heikki Linnakangas, Thomas Munro)
Speed up lookups of built-in functions by OID (Andres Freund)
The previous binary search has been replaced by a lookup array.
Speed up construction of query results (Andres Freund)
Improve speed of access to system caches (Andres Freund)
Add a generational memory allocator which is optimized for serial allocation/deallocation (Tomas Vondra)
This reduces memory usage for logical decoding.
Make the computation of pg_class
.reltuples
by VACUUM
consistent with its computation by ANALYZE
(Tomas Vondra)
Update to use perltidy version 20170521
(Tom Lane, Peter Eisentraut)
Allow extension pg_prewarm
to restore the previous shared buffer contents on startup (Mithun Cy, Robert Haas)
This is accomplished by having pg_prewarm
store the shared buffers' relation and block number data to disk occasionally during server operation, and at shutdown.
Add pg_trgm
function strict_word_similarity()
to compute the similarity of whole words (Alexander Korotkov)
The function word_similarity()
already existed for this purpose, but it was designed to find similar parts of words, while strict_word_similarity()
computes the similarity to whole words.
Allow btree_gin
to index bool
, bpchar
, name
and uuid
data types (Matheus Oliveira)
Allow cube
and seg
extensions to perform index-only scans using GiST indexes (Andrey Borodin)
Allow retrieval of negative cube coordinates using the ~>
operator (Alexander Korotkov)
This is useful for KNN-GiST searches when looking for coordinates in descending order.
Add Vietnamese letter handling to the unaccent
extension (Dang Minh Huong, Michael Paquier)
Enhance amcheck
to check that each heap tuple has an index entry (Peter Geoghegan)
Have adminpack
use the new default file system access roles (Stephen Frost)
Previously, only superusers could call adminpack
functions; now role permissions are checked.
Widen pg_stat_statement
's query ID to 64 bits (Robert Haas)
This greatly reduces the chance of query ID hash collisions. The query ID can now potentially display as a negative value.
Remove the contrib/start-scripts/osx
scripts since they are no longer recommended (use contrib/start-scripts/macos
instead) (Tom Lane)
Remove the chkpass
extension (Peter Eisentraut)
This extension is no longer considered to be a usable security tool or example of how to write an extension.
⇑ Upgrade to 11.1 released on 2018-11-08 - docs
Apply the tablespace specified for a partitioned index when creating a child index (Álvaro Herrera)
Previously, child indexes were always created in the default tablespace.
Fix NULL handling in parallel hashed multi-batch left joins (Andrew Gierth, Thomas Munro)
Outer-relation rows with null values of the hash key were omitted from the join result.
Fix incorrect processing of an array-type coercion expression appearing within a CASE
clause that has a constant test expression (Tom Lane)
Fix incorrect expansion of tuples lacking recently-added columns (Andrew Dunstan, Amit Langote)
This is known to lead to crashes in triggers on tables with recently-added columns, and could have other symptoms as well.
Fix bugs with named or defaulted arguments in CALL
argument lists (Tom Lane, Pavel Stehule)
Fix strictness check for strict aggregates with ORDER BY
columns (Andrew Gierth, Andres Freund)
The strictness logic incorrectly ignored rows for which the ORDER BY
value(s) were null.
Disable recheck_on_update
optimization (Tom Lane)
This new-in-v11 feature turns out not to have been ready for prime time. Disable it until something can be done about it.
Fix pg_verify_checksums's determination of which files to check the checksums of (Michael Paquier)
In some cases it complained about files that are not expected to have checksums.
In contrib/pg_stat_statements
, disallow the pg_read_all_stats
role from executing pg_stat_statements_reset()
(Haribabu Kommi)
pg_read_all_stats
is only meant to grant permission to read statistics, not to change them, so this grant was incorrect.
To cause this change to take effect, run ALTER EXTENSION pg_stat_statements UPDATE
in each database where pg_stat_statements
has been installed. (A database freshly created in 11.0 should not need this, but a database upgraded from a previous release probably still contains the old version of pg_stat_statements
. The UPDATE
command is harmless if the module was already updated.)
⇑ Upgrade to 11.2 released on 2019-02-14 - docs
Fix handling of unique indexes with INCLUDE
columns on partitioned tables (Álvaro Herrera)
The uniqueness condition was not checked properly in such cases.
Update catalog state correctly for partition table constraints when detaching their partition (Amit Langote, Álvaro Herrera)
Previously, the pg_constraint
.conislocal
field for such a constraint might improperly be left as false
, rendering it undroppable. A dump/restore or pg_upgrade would cure the problem, but if necessary, the catalog field can be adjusted manually.
Create or delete foreign key enforcement triggers correctly when attaching or detaching a partition in a partitioned table that has a foreign-key constraint (Amit Langote, Álvaro Herrera)
Avoid useless creation of duplicate foreign key constraints in partitioned tables (Álvaro Herrera)
When an index is created on a partitioned table using ONLY
, and there are no partitions yet, mark it valid immediately (Álvaro Herrera)
Otherwise there is no way to make it become valid.
Fix possible index corruption when the indexed column has a “fast default” (that is, it was added by ALTER TABLE ADD COLUMN
with a constant non-NULL default value specified, after the table already contained some rows) (Andres Freund)
Correctly adjust “fast default” values during ALTER TABLE ... ALTER COLUMN TYPE
(Andrew Dunstan)
Fix crash when zero rows are fed to json[b]_populate_recordset()
or json[b]_to_recordset()
(Tom Lane)
Fix incorrect JIT tuple deforming code for tables with many columns (more than approximately 800) (Andres Freund)
Fix performance and memory leakage issues in hash-based grouping (Andres Freund)
Fix parsing of collation-sensitive expressions in the arguments of a CALL
statement (Peter Eisentraut)
Ensure proper cleanup after detecting an error in the argument list of a CALL
statement (Tom Lane)
Fix planner failure when the first column of a row comparison matches an index column, but later column(s) do not, and the index has included (non-key) columns (Tom Lane)
Improve planning speed for large inheritance or partitioning table groups (Amit Langote, Etsuro Fujita)
Fix parsing of space-separated lists of host names in the ldapserver
parameter of LDAP authentication entries in pg_hba.conf
(Thomas Munro)
Make pgbench's random number generation fully deterministic and platform-independent when --random-seed=
is specified (Fabien Coelho, Tom Lane)N
On any specific platform, the sequence obtained with a particular value of N
will probably be different from what it was before this patch.
Fix pg_basebackup and pg_verify_checksums to ignore temporary files appropriately (Michael Banck, Michael Paquier)
Make pg_dump include ALTER INDEX SET STATISTICS
commands (Michael Paquier)
When the ability to attach statistics targets to index expressions was added, we forgot to teach pg_dump about it, so that such settings were lost in dump/reload.
Fix pg_dump's dumping of tables that have OIDs (Peter Eisentraut)
The WITH OIDS
clause was omitted if it needed to be applied to the first table to be dumped.
Prevent false index-corruption reports from contrib/amcheck
caused by inline-compressed data (Peter Geoghegan)
Include JIT-related headers in the installed set of header files (Donald Dong)
⇑ Upgrade to 11.3 released on 2019-05-09 - docs
Avoid access to already-freed memory during partition routing error reports (Michael Paquier)
This mistake could lead to a crash, and in principle it might be possible to use it to disclose server memory contents. (CVE-2019-10129)
Avoid catalog corruption when an ALTER TABLE
on a partitioned table finds that a partitioned index is reusable (Amit Langote, Tom Lane)
This occurs, for example, when ALTER COLUMN TYPE
finds that no physical table rewrite is required.
Fix failure in ALTER INDEX ... ATTACH PARTITION
if the partitioned table contains more dropped columns than its partition does (Álvaro Herrera)
Fix failure to attach a partition's existing index to a newly-created partitioned index in some cases (Amit Langote, Álvaro Herrera)
This would lead to errors such as “index ... not found in partition” in subsequent DDL that uses the partitioned index.
Fix tuple routing in multi-level partitioned tables that have dropped attributes (Amit Langote, Michael Paquier)
Fix failure when the slow path of foreign key constraint initial validation is applied to partitioned tables (Hadi Moshayedi, Tom Lane, Andres Freund)
This didn't manifest except in the uncommon cases where the fast path can't be used (such as permissions problems).
When accessing a partition directly, and constraint_exclusion
is set to on
, use the partition's partition constraint as well as any CHECK
constraints for exclusion checking (Amit Langote, Tom Lane)
This change restores the behavior to what it was in v10.
Avoid server crash when an error occurs while trying to persist a cursor query across a transaction commit (Tom Lane)
If a procedure attempts to commit while it has an open explicit or implicit cursor (for example, a PL/pgSQL FOR
-loop query), the cursor must be executed to completion and its results saved before the transaction commit can be performed. An error occurring during such execution led to a crash.
Avoid possible division-by-zero in btree index vacuum logic (Piotr Stefaniak, Alexander Korotkov)
This could lead to incorrect decisions about whether index cleanup is needed.
Avoid server memory leak when fetching rows from a portal one at a time (Tom Lane)
Avoid crash when trying to plan a partition-wise join when GEQO is active (Tom Lane)
Fix planner's parallel-safety assessment for grouped queries (Etsuro Fujita)
Previously, target-list evaluation work that could have been parallelized might not be.
Fix mishandling of “included” index columns in planner's unique-index logic (Tom Lane)
This could result in failing to recognize that a unique index with included columns proves uniqueness of a query result, leading to a poor plan.
Fix incorrect strictness check for array coercion expressions (Tom Lane)
This might allow, for example, incorrect inlining of a strict SQL function, leading to non-enforcement of the strictness condition.
Fix authentication failure when attempting to use SCRAM authentication with mixed OpenSSL library versions (Michael Paquier, Peter Eisentraut)
If libpq is using OpenSSL 1.0.1 or older while the server is using OpenSSL 1.0.2 or newer, the negotiation of which SASL mechanism to use went wrong, leading to a confusing “channel binding not supported by this build” error message.
Create the current_logfiles
file with the same permissions as other files in the server's data directory (Haribabu Kommi)
Previously it used the permissions specified by log_file_mode
, but that can cause problems for backup utilities.
Fix pg_rewind failures due to failure to remove some transient files in the target data directory (Michael Paquier)
Make pg_verify_checksums verify that the data directory it's pointed at is of the right PostgreSQL version (Michael Paquier)
Change contrib/postgres_fdw
to report an error when a remote partition chosen to insert a routed row into is also an UPDATE
subplan target that will be updated later in the same command (Amit Langote, Etsuro Fujita)
Previously, such situations led to server crashes or incorrect results of the UPDATE
. Allowing such cases to work correctly is a matter for future work.
In contrib/pg_prewarm
, avoid indefinitely respawning background worker processes if prewarming fails for some reason (Mithun Cy)
⇑ Upgrade to 11.4 released on 2019-06-20 - docs
Fix assorted errors in run-time partition pruning logic (Tom Lane, Amit Langote, David Rowley)
These mistakes could lead to wrong answers in queries on partitioned tables, if the comparison value used for pruning is dynamically determined, or if multiple range-partitioned columns are involved in pruning decisions, or if stable (not immutable) comparison operators are involved.
Fix possible crash while trying to copy trigger definitions to a new partition (Tom Lane)
Fix incorrect argument null-ness checking during partial aggregation of aggregates with zero or multiple arguments (David Rowley, Kyotaro Horiguchi, Andres Freund)
Avoid writing an invalid empty btree index page in the unlikely case that a failure occurs while processing INCLUDEd columns during a page split (Peter Geoghegan)
The invalid page would not affect normal index operations, but it might cause failures in subsequent VACUUMs. If that has happened to one of your indexes, recover by reindexing the index.
⇑ Upgrade to 11.5 released on 2019-08-08 - docs
Fix execution of hashed subplans that require cross-type comparison (Tom Lane, Andreas Seltenreich)
Hashed subplans used the outer query's original comparison operator to compare entries of the hash table. This is the wrong thing if that operator is cross-type, since all the hash table entries will be of the subquery's output type. For the set of hashable cross-type operators in core PostgreSQL, this mistake seems nearly harmless on 64-bit machines, but it can result in crashes or perhaps unauthorized disclosure of server memory on 32-bit machines. Extensions might provide hashable cross-type operators that create larger risks. (CVE-2019-10209)
Prevent dropping a partitioned table's trigger if there are pending trigger events in child partitions (Álvaro Herrera)
This notably applies to foreign key constraints, since those are implemented by triggers.
Include user-specified trigger arguments when copying a trigger definition from a partitioned table to one of its partitions (Patrick McHardy)
Ensure that column numbers are correctly mapped between a partitioned table and its default partition (Amit Langote)
Some operations misbehaved if the mapping wasn't exactly one-to-one, for example if there were dropped columns in one table and not the other.
Ignore partitions that are foreign tables when creating indexes on partitioned tables (Álvaro Herrera)
Previously an error was thrown on encountering a foreign-table partition, but that's unhelpful and doesn't protect against any actual problem.
Prune a partitioned table's default partition (that is, avoid uselessly scanning it) in more cases (Yuzuko Hosoya)
Fix possible failure to prune partitions when there are multiple partition key columns of boolean
type (David Rowley)
Avoid incorrect use of parallel hash join for semi-join queries (Thomas Munro)
This error resulted in duplicate result rows from some EXISTS
queries.
Fix possible failure of planner's index endpoint probes (Tom Lane)
When using a recently-created index to determine the minimum or maximum value of a column, the planner could select a recently-dead tuple that does not actually contain the endpoint value. In the worst case the tuple might contain a null, resulting in a visible error “found unexpected null value in index”; more likely we would just end up using the wrong value, degrading the quality of planning estimates.
Fix printing of BTREE_META_CLEANUP
WAL records (Michael Paquier)
Prevent assertion failures due to mishandling of version-2 btree metapages (Peter Geoghegan)
Ensure that a record or row value returned from a PL/pgSQL function is marked with the function's declared composite type (Tom Lane)
This avoids problems if the result is stored directly into a table.
Improve reliability of contrib/amcheck
's index verification (Peter Geoghegan)
Fix handling of Perl undef
values in contrib/jsonb_plperl
(Ivan Panchenko)
Improve stability of src/test/kerberos
and src/test/ldap
regression tests (Thomas Munro, Tom Lane)
Fix pgbench regression tests to work on Windows (Fabien Coelho)
⇑ Upgrade to 12 released on 2019-10-03 - docs
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 promote_trigger_file. The standby_mode
setting has been removed.
Do not allow multiple conflicting recovery_target
* specifications (Peter Eisentraut)
Specifically, only allow one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, and recovery_target_xid. 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, recovery_target_timeline 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 extra_float_digits. 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 pg_checksums (Michaël Paquier)
In pg_restore, 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 REINDEX 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)
Remove obsolete pg_attrdef
.adsrc
column (Peter Eisentraut)
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, dynamic_shared_memory_type 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.
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)
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)
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)
Allow CREATE STATISTICS 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 plan_cache_mode 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
clauses.x
IN (array
)
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.
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)
Allow logging of statements from only a percentage of transactions (Adrien Nayrat)
The parameter log_transaction_sample_rate 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 pg_checksums (Michael Banck, Bernd Helmle)
This is enabled with the option --progress
.
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 application_name, if set, in log_connections 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)
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 gssencmode libpq option, and a pg_stat_gssapi system view.
Allow the clientcert
pg_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.
Add ability to enable/disable cluster checksums using pg_checksums (Michael Banck, Michaël Paquier)
The cluster must be shut down for these operations.
Reduce the default value of autovacuum_vacuum_cost_delay to 2ms (Tom Lane)
This allows autovacuum operations to proceed faster by default.
Allow vacuum_cost_delay 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 wal_recycle and wal_init_zero 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 tcp_user_timeout 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 ssl_min_protocol_version and ssl_max_protocol_version.
Add server parameter ssl_library to report the SSL library version used by the server (Peter Eisentraut)
Add server parameter shared_memory_type to control the type of shared memory to use (Andres Freund)
This allows selection of System V shared memory, if desired.
Allow some recovery parameters to be changed with reload (Peter Eisentraut)
These parameters are archive_cleanup_command, promote_trigger_file, recovery_end_command, and recovery_min_apply_delay.
Allow the streaming replication timeout (wal_sender_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 pg_ctl 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 max_wal_senders not count as part of max_connections (Alexander Kukushkin)
Add an explicit value of current
for recovery_target_timeline (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.
Add REINDEX CONCURRENTLY
option to allow reindexing without locking out writes (Michaël Paquier, Andreas Karlsson, Peter Eisentraut)
This is also controlled by the reindexdb application's --concurrently
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 VACUUM 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 TRUNCATE, 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 EXPLAIN option SETTINGS
to output non-default optimizer settings (Tomas Vondra)
This output can also be obtained when using auto_explain by setting auto_explain.log_settings
.
Add OR REPLACE
option to CREATE AGGREGATE (Andrew Gierth)
Allow modifications of system catalogs' options using ALTER TABLE (Peter Eisentraut)
Modifications of catalogs' reloptions
and autovacuum settings are now supported. (Setting allow_system_table_mods 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.
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.
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)
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.
Add connection parameter tcp_user_timeout 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 ecpg 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)
Allow vacuumdb to select tables for vacuum based on their wraparound horizon (Nathan Bossart)
The options are --min-xid-age
and --min-mxid-age
.
Allow vacuumdb to disable waiting for locks or skipping all-visible pages (Nathan Bossart)
The options are --skip-locked
and --disable-page-skipping
.
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 --csv
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)
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 --rate
option (Tom Lane)
Improve pgbench's error reporting with clearer messages and return codes (Peter Eisentraut)
Allow control of log file rotation via pg_ctl (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 pg_upgrade to use the file system's cloning feature, if there is one (Peter Eisentraut)
The --clone
option has the advantages of --link
, 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 --socketdir
; the default is the current directory.
Allow pg_checksums to disable fsync operations (Michaël Paquier)
This is controlled by the --no-sync
option.
Allow pg_rewind to disable fsync operations (Michaël Paquier)
Fix pg_test_fsync to report accurate open_datasync
durations on Windows (Laurenz Albe)
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 --rows-per-insert
.
Allow pg_dump to emit INSERT ... ON CONFLICT DO NOTHING
(Surafel Temesgen)
This avoids conflict failures during restore. The option is --on-conflict-do-nothing
.
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 extra_float_digits 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 --exclude-database
option to pg_dumpall (Andrew Dunstan)
Add CREATE ACCESS METHOD 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 --disable-strong-random
(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)
Allow ORDER BY
sorts and LIMIT
clauses to be pushed to postgres_fdw 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 OPTION
s on postgres_fdw tables are ignored (because the reference is foreign), views on such tables are considered local, so this change enforces CHECK OPTION
s on them. Previously, only INSERT
s and UPDATE
s 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 auto_explain log level (Tom Dunstan, Andrew Dunstan)
The default is LOG
.
Update unaccent 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 amcheck's bt_index_parent_check()
function to check each index tuple from the root of the tree (Peter Geoghegan)
Improve oid2name and vacuumlo option handling to match other commands (Tatsuro Yamada)
⇑ Upgrade to 12.1 released on 2019-11-14 - docs
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.
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.
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.
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 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.
Avoid memory leak while vacuuming a GiST index (Dilip Kumar)
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 connect_timeout
parameter value (Lars Kanis)
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_upgrade, reject tables with columns of type sql_identifier
, as that has changed representation in version 12 (Tomas Vondra)
In pg_rewind with the --dry-run
option, avoid updating pg_control
(Alexey Kondratov)
This could lead to failures in subsequent pg_rewind attempts.
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.
⇑ Upgrade to 12.2 released on 2020-02-13 - docs
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.
Ensure that the effect of pg_replication_slot_advance()
on a physical replication slot will persist across restarts (Alexey Kondratov, Michael Paquier)
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.
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.
Fix crash during recursive page split in GiST index build (Heikki Linnakangas)
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 handling of multiple AFTER ROW
triggers on a foreign table (Etsuro Fujita)
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.
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 incorrect estimation for OR
clauses when using most-common-value extended statistics (Tomas Vondra)
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.
Avoid crash after an out-of-memory failure in ecpglib (Tom Lane)
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.
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.
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, 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)
⇑ Upgrade to 12.3 released on 2020-05-14 - docs
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 rebuilt by REINDEX CONCURRENTLY
(Justin Pryzby)
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.
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 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.
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.
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 possible failure after a replication slot copy, due to premature removal of WAL data (Masahiko Sawada, Arseny Sher)
Ensure that generated columns are correctly handled during updates issued by logical replication (Peter Eisentraut)
Fix crash in psql when attempting to re-establish a failed connection (Michael Paquier)
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)
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.
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.
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)
Fix Makefile dependencies for libpq and ecpg (Dagfinn Ilmari Mannsåker)
⇑ Upgrade to 12.4 released on 2020-08-13 - docs
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)
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.
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 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.
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.
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.
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)
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)
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 contrib/amcheck
to not complain about deleted index pages that are empty (Alexander Korotkov)
This state of affairs is normal during WAL replay.
⇑ Upgrade to 12.5 released on 2020-11-12 - docs
Ensure that ALTER TABLE ONLY ... ENABLE/DISABLE TRIGGER
does not recurse to child tables (Álvaro Herrera)
Previously the ONLY
flag was ignored.
Avoid unnecessary recursion to partitions in ALTER TABLE SET NOT NULL
, when the target column is already marked NOT NULL
(Tom Lane)
This avoids a potential deadlock in parallel pg_restore.
Disallow DROP INDEX CONCURRENTLY
on a partitioned table (Álvaro Herrera, Michael Paquier)
This case failed anyway, but with a confusing error message.
Allow LOCK TABLE
to succeed on a self-referential view (Tom Lane)
It previously threw an error complaining about infinite recursion, but there seems no need to disallow the case.
Retain statistics about an index across REINDEX CONCURRENTLY
(Michael Paquier, Fabrízio de Royes Mello)
Non-concurrent reindexing has always preserved such statistics.
Fix incorrect progress reporting from REINDEX CONCURRENTLY
(Matthias van de Meent, Michael Paquier)
Ensure that GENERATED
columns are updated when the column(s) they depend on are updated via a rule or an updatable view (Tom Lane)
This fix also takes care of possible failure to fire a column-specific trigger in such cases.
Recheck default partition constraints while routing an inserted or updated tuple to the correct partition (Amit Langote, Álvaro Herrera)
This fixes race conditions when partitions are added concurrently with the insertion.
Fix failures with collation-dependent partition bound expressions (Tom Lane)
Support hashing of text arrays (Peter Eisentraut)
Array hashing failed if the array element type is collatable. Notably, this prevented using hash partitioning with a text array column as partition key.
Fix possible crash when considering partition-wise joins during GEQO planning (Tom Lane)
Fix buffered GiST index builds to work when the index has included columns (Pavel Borisov)
Avoid crash if debug_query_string
is NULL when starting a parallel worker (Noah Misch)
Avoid failures when a BEFORE ROW UPDATE
trigger returns the “old” row of a table having dropped or “missing” columns (Amit Langote, Tom Lane)
This method of suppressing an update could result in crashes, unexpected CHECK
constraint failures, or incorrect RETURNING
output, because “missing” columns would read as NULLs for those purposes. (A column is “missing” for this purpose if it was added by ALTER TABLE ADD COLUMN
with a non-NULL, but constant, default value.) Dropped columns could cause trouble as well.
Fix incorrect handling of template function attributes in JIT code generation (Andres Freund)
This has been shown to cause crashes on s390x
, and very possibly there are other cases on other platforms.
Fix edge-case memory leak in index_get_partition()
(Justin Pryzby)
Fix memory leaks in PL/pgsql's CALL
processing (Pavel Stehule, Tom Lane)
Ensure that parallel pg_restore processes foreign keys referencing partitioned tables in the correct order (Álvaro Herrera)
Previously, it might try to restore a foreign key constraint before the required indexes were all in place, leading to an error.
⇑ Upgrade to 12.6 released on 2021-02-11 - docs
Fix information leakage in constraint-violation error messages (Heikki Linnakangas)
If an UPDATE
command attempts to move a row to a different partition but finds that it violates some constraint on the new partition, and the columns in that partition are in different physical positions than in the parent table, the error message could reveal the contents of columns that the user does not have SELECT
privilege on. (CVE-2021-3393)
Fix incorrect detection of concurrent page splits while inserting into a GiST index (Heikki Linnakangas)
Concurrent insertions could lead to a corrupt index with entries placed in the wrong pages. It's recommended to reindex any GiST index that's been subject to concurrent insertions.
Avoid crash when a CALL
or DO
statement that performs a transaction rollback is executed via extended query protocol (Thomas Munro, Tom Lane)
In PostgreSQL 13, this case reliably caused a null-pointer dereference. In earlier versions the bug seems to have no visible symptoms, but it's not quite clear that it could never cause a problem.
Fix partition pruning logic to handle asymmetric hash partition sets (Tom Lane)
If a hash-partitioned table has unequally-sized partitions (that is, varying modulus values), or it lacks partitions for some remainder values, then the planner's pruning logic could mistakenly conclude that some partitions don't need to be scanned, leading to failure to find rows that the query should find.
Fix planner's mishandling of placeholders whose evaluation should be delayed by an outer join (Tom Lane)
This occurs in particular with trivial subqueries containing lateral references to outer-join outputs. The mistake could result in a malformed plan. The known cases trigger a “failed to assign all NestLoopParams to plan nodes” error, but other symptoms may be possible.
Fix planner's handling of placeholders during removal of useless RESULT RTEs (Tom Lane)
This oversight could lead to “no relation entry for relid N
” planner errors.
Fix overestimate of the amount of shared memory needed for parallel queries (Takayuki Tsunakawa)
Prevent dropping a tablespace that is referenced by a partitioned relation, but is not used for any actual storage (Álvaro Herrera)
Previously this was allowed, but subsequent operations on the partitioned relation would fail.
Fix progress reporting for CLUSTER
(Matthias van de Meent)
Fix integer-overflow cases in substring()
functions (Tom Lane, Pavel Stehule)
If the specified starting index and length overflow an integer when added together, substring()
misbehaved, either throwing a bogus “negative substring length” error for a case that should succeed, or failing to complain that a negative length is negative (and instead returning the whole string, in most cases).
Fix possible failure to detect recovery conflicts while deleting an index entry that references a HOT chain (Peter Geoghegan)
The code failed to traverse the HOT chain and might thus compute a too-old XID horizon, which could lead to incorrect conflict processing in hot standby. The practical impact of this bug is limited; in most cases the correct XID horizon would be found anyway from nearby operations.
Ensure that a nonempty value of krb_server_keyfile
always overrides any setting of KRB5_KTNAME
in the server's environment (Tom Lane)
Previously, which setting took precedence depended on whether the client requests GSS encryption.
In server log messages about failing to match connections to pg_hba.conf
entries, include details about whether GSS encryption has been activated (Kyotaro Horiguchi, Tom Lane)
This is relevant data if hostgssenc
or hostnogssenc
entries exist.
Fix assorted issues in server's support for GSS encryption (Tom Lane)
Remove pointless restriction that only GSS authentication can be used on a GSS-encrypted connection. Add GSS encryption information to connection-authorized log messages. Include GSS-related space when computing the required size of shared memory (this omission could have caused problems with very high max_connections
settings). Avoid possible infinite recursion when reporting an unrecoverable GSS encryption error.
Avoid trying to use parallel index build in a standalone backend (Yulin Pei)
Allow index AMs to support included columns without necessarily supporting multiple key columns (Tom Lane)
Avoid assertion failure during parallel aggregation of an aggregate with a non-strict deserialization function (Andrew Gierth)
No such aggregate functions exist in core PostgreSQL, but some extensions such as PostGIS provide some. The mistake is harmless anyway in a non-assert build.
Fix data structure misallocation in PL/pgSQL's CALL
statement (Tom Lane)
A CALL
in a PL/pgSQL procedure, to another procedure that has OUT parameters, would fail if the called procedure did a COMMIT
or ROLLBACK
.
In libpq, do not skip trying SSL after GSS encryption (Tom Lane)
If we successfully made a GSS-encrypted connection, but then failed during authentication, we would fall back to an unencrypted connection rather than next trying an SSL-encrypted connection. This could lead to unexpected connection failure, or to silently getting an unencrypted connection where an encrypted one is expected. Fortunately, GSS encryption could only succeed if both client and server hold valid tickets in the same Kerberos infrastructure. It seems unlikely for that to be true in an environment that requires SSL encryption instead.
In psql's \d
commands, don't truncate the display of column default values (Tom Lane)
Formerly, they were arbitrarily truncated at 128 characters.
Fix pg_dump's dumping of inherited generated columns (Peter Eisentraut)
The previous behavior resulted in (harmless) errors during restore.
In pg_dump, ensure that the restore script runs ALTER PUBLICATION ADD TABLE
commands as the owner of the publication, and similarly runs ALTER INDEX ATTACH PARTITION
commands as the owner of the partitioned index (Tom Lane)
Previously, these commands would be run by the role that started the restore script; which will usually work, but in corner cases that role might not have adequate permissions.
In pgbench, disallow a digit as the first character of a variable name (Fabien Coelho)
This prevents trying to substitute variables into timestamp literal values, which may contain strings like 12:34
.
Make contrib/pg_prewarm
more robust when the cluster is shut down before prewarming is complete (Tom Lane)
Previously, autoprewarm would rewrite its status file with only the block numbers that it had managed to load so far, thus perhaps largely disabling the prewarm functionality in the next startup. Instead, suppress status file updates until the initial loading pass is complete.
Fix JIT compilation to be compatible with LLVM 11 and LLVM 12 (Andres Freund)
Fix potential mishandling of references to boolean variables in JIT expression compilation (Andres Freund)
No field reports attributable to this have been seen, but it seems likely that it could cause problems on some architectures.
Fix compile failure with ICU 68 and later (Tom Lane)
Avoid memcpy()
with a NULL source pointer and zero count during partitioned index creation (Álvaro Herrera)
While such a call is not known to cause problems in itself, some compilers assume that the arguments of memcpy()
are never NULL, which could result in incorrect optimization of nearby code.
⇑ Upgrade to 12.7 released on 2021-05-13 - docs
Fix possibly-incorrect computation of UPDATE ... RETURNING
outputs for joined cross-partition updates (Amit Langote, Etsuro Fujita)
If an UPDATE
for a partitioned table caused a row to be moved to another partition with a physically different row type (for example, one with a different set of dropped columns), computation of RETURNING
results for that row could produce errors or wrong answers. No error is observed unless the UPDATE
involves other tables being joined to the target table. (CVE-2021-32029)
Fix adjustment of constraint deferrability properties in partitioned tables (Álvaro Herrera)
When applied to a foreign-key constraint of a partitioned table, ALTER TABLE ... ALTER CONSTRAINT
failed to adjust the DEFERRABLE
and/or INITIALLY DEFERRED
markings of the constraints and triggers of leaf partitions. This led to unexpected behavior of such constraints. After updating to this version, any misbehaving partitioned tables can be fixed by executing a new ALTER
command to set the desired properties.
This change also disallows applying such an ALTER
directly to the constraints of leaf partitions. The only supported case is for the whole partitioning hierarchy to have identical constraint properties, so such ALTER
s must be applied at the partition root.
When attaching a child table with ALTER TABLE ... INHERIT
, insist that any generated columns in the parent be generated the same way in the child (Peter Eisentraut)
Ensure that REINDEX CONCURRENTLY
preserves any statistics target that's been set for the index (Michael Paquier)
Fix COMMIT AND CHAIN
to work correctly when the current transaction has live savepoints (Fujii Masao)
Fix use-after-free bug in saving tuples for AFTER
triggers (Amit Langote)
This could cause crashes in some situations.
Pass the correct trigger OID to object post-alter hooks during ALTER CONSTRAINT
(Álvaro Herrera)
When updating trigger properties during ALTER CONSTRAINT
, the post-alter hook was told that we are updating a trigger, but the constraint's OID was passed instead of the trigger's.
Fix failure when a PL/pgSQL DO
block makes use of both composite-type variables and transaction control (Tom Lane)
Previously, such cases led to errors about leaked tuple descriptors.
Fix psql's ON_ERROR_ROLLBACK
feature to handle COMMIT AND CHAIN
commands correctly (Arthur Nascimento)
Previously, this case failed with “savepoint "pg_psql_temporary_savepoint" does not exist”.
Fix pg_dump's dumping of generated columns in partitioned tables (Peter Eisentraut)
A fix introduced in the previous minor release should not be applied to partitioned tables, only traditionally-inherited tables.
Fix incorrect progress-reporting calculation in pg_checksums (Shinya Kato)