PostgreSQL Release Notes
The release notes contain the significant changes in each PostgreSQL release. The release notes do not contain changes that affect only a few users or changes that are internal and therefore not user-visible. For example, the optimizer is improved in almost every release, but the improvements are usually observed by users as simply faster queries.
Release 16
Overview
PostgreSQL 16 contains many new features and enhancements, including:
-
Allow parallelization of FULL and internal right OUTER hash joins
-
Allow logical replication from standby servers
-
Allow logical replication subscribers to apply large transactions in parallel
-
Allow monitoring of I/O statistics using the new pg_stat_io view
-
Add SQL/JSON constructors and identity functions
-
Improve performance of vacuum freezing
-
Add support for regular expression matching of user and database names in qhb_hba.conf, and user names in qhb_ident.conf
The above items and other new features of PostgreSQL 16 are explained in more detail in the sections below.
Changes
Below you will find a detailed account of the changes between PostgreSQL 16 and the previous major release.
Server
Optimizer
-
Allow incremental sorts in more cases, including DISTINCT.
-
Add the ability for aggregates having ORDER BY or DISTINCT to use pre-sorted data.
The new server variable enable_presorted_aggregate can be used to disable this. -
Allow memoize atop a UNION ALL.
-
Allow anti-joins to be performed with the non-nullable input as the inner relation.
-
Allow parallelization of FULL and internal right OUTER hash joins.
-
Improve the accuracy of GIN index access optimizer costs.
General Performance
-
Allow more efficient addition of heap and index pages.
-
During non-freeze operations, perform page freezing where appropriate.
This makes full-table freeze vacuums less necessary. -
Allow window functions to use the faster ROWS mode internally when RANGE mode is active but unnecessary.
-
Allow optimization of always-increasing window functions ntile(), cume_dist() and percent_rank().
-
Allow aggregate functions string_agg() and array_agg() to be parallelized.
-
Improve performance by caching RANGE and LIST partition lookups.
-
Allow control of the shared buffer usage by vacuum and analyze.
-
The VACUUM/ANALYZE option is BUFFER_USAGE_LIMIT, and the vacuumdb option is --buffer-usage-limit. The default value is set by server variable vacuum_buffer_usage_limit, which also controls autovacuum.
-
Support wal_sync_method=fdatasync on Windows.
-
Allow HOT updates if only BRIN-indexed columns are updated.
-
Improve the speed of updating the process title.
-
Allow xid/subxid searches and ASCII string detection to use vector operations.
ASCII detection is particularly useful for COPY FROM. Vector operations are also used for some C array searches. -
Reduce overhead of memory allocations.
Monitoring
-
Add pg_stat_io system view to track I/O statistics.
-
Record statistics on the last sequential and index scans on tables.
This information appears in pg_stat_all_tables and pg_stat_all_indexes. -
Record statistics on the occurrence of updated rows moving to new pages.
The pg_stat_all_tables column is n_tup_newpage_upd. -
Add speculative lock information to the pg_locks system view.
The transaction id is displayed in the transactionid column and the speculative insertion token is displayed in the objid column. -
Add the display of prepared statement result types to the pg_prepared_statements view.
-
Create subscription statistics entries at subscription creation time so stats_reset is accurate.
Previously entries were created only when the first statistics were reported. -
Correct the I/O accounting for temp relation writes shown in pg_stat_database.
-
Add function pg_stat_get_backend_subxact() to report on a session's subtransaction cache.
-
Have pg_stat_get_backend_idset(), pg_stat_get_backend_activity(), and related functions use the unchanging backend id.
Previously the index values might change during the lifetime of the session. -
Report stand-alone backends with a special backend type.
-
Add wait event SpinDelay to report spinlock sleep delays.
-
Create new wait event DSMAllocate to indicate waiting for dynamic shared memory allocation.
Previously this type of wait was reported as DSMFillZeroWrite, which was also used by mmap() allocations. -
Add the database name to the process title of logical WAL senders.
Physical WAL senders do not display a database name. -
Add checkpoint and REDO LSN information to log_checkpoints messages.
-
Provide additional details during client certificate failures.
Privileges
-
Add predefined role pg_create_subscription with permission to create subscriptions.
-
Allow subscriptions to not require passwords.
This is accomplished with the option password_required=false. -
Simplify permissions for LOCK TABLE.
Previously a user's ability to performLOCK TABLEat various lock levels was limited to the lock levels required by the commands they had permission to execute on the table. For example, someone with UPDATE permission could perform all lock levels except ACCESS SHARE, even though it was a lesser lock level. Now users can issue lesser lock levels if they already have permission for greater lock levels. -
Allow ALTER GROUP group_name ADD USER user_name to be performed with ADMIN OPTION.
Previously CREATEROLE permission was required. -
Allow GRANT to use WITH ADMIN TRUE/FALSE syntax.
Previously only the WITH ADMIN OPTION syntax was supported. -
Allow roles that create other roles to automatically inherit the new role's rights or the ability to SET ROLE to the new role.
This is controlled by server variable createrole_self_grant. -
Prevent users from changing the default privileges of non-inherited roles.
This is now only allowed for inherited roles. -
When granting role membership, require the granted-by role to be a role that has appropriate permissions.
This is a requirement even when a non-bootstrap superuser is granting role membership. -
Allow non-superusers to grant permissions using a granted-by user that is not the current user.
The current user still must have sufficient permissions given by the specified granted-by user. -
Add GRANT to control permission to use SET ROLE.
This is controlled by a newGRANT ... SEToption. -
Add dependency tracking to roles which have granted privileges.
For example, removing ADMIN OPTION will fail if there are privileges using that option; CASCADE must be used to revoke dependent permissions. -
Add dependency tracking of grantors for GRANT records.
This guarantees that pg_auth_members.grantor values are always valid. -
Allow multiple role membership records.
Previously a new membership grant would remove a previous matching membership grant, even if other aspects of the grant did not match. -
Prevent removal of superuser privileges for the bootstrap user.
Restoring such users could lead to errors. -
Allow makeaclitem() to accept multiple privilege names.
Previously only a single privilege name, like SELECT, was accepted.
Server Configuration
-
Add support for Kerberos credential delegation.
This is enabled with server variable gss_accept_delegation and libpq connection parameter gssdelegation. -
Allow the SCRAM iteration count to be set with server variable scram_iterations.
-
Improve performance of server variable management.
-
Tighten restrictions on which server variables can be reset.
Previously, while certain variables, like transaction_isolation, were not affected by RESET ALL, they could be individually reset in inappropriate situations. -
Move various qhb.conf items into new categories.
This also affects the categories displayed in the pg_settings view. -
Prevent configuration file recursion beyond 10 levels.
-
Allow autovacuum to more frequently honor changes to delay settings.
Rather than honor changes only at the start of each relation, honor them at the start of each block. -
Remove restrictions that archive files be durably renamed.
The archive_command command is now more likely to be called with already-archived files after a crash. -
Prevent archive_library and archive_command from being set at the same time.
Previously archive_library would override archive_command. -
Allow the qhbmaster to terminate children with an abort signal.
This allows collection of a core dump for a stuck child process. This is controlled by send_abort_for_crash and send_abort_for_kill. The qhbmaster's -T switch is now the same as setting send_abort_for_crash. -
Remove the non-functional qhbmaster -n option.
-
Allow the server to reserve backend slots for roles with pg_use_reserved_connections membership.
The number of reserved slots is set by server variable reserved_connections. -
Allow huge pages to work on newer versions of Windows 10.
This adds the special handling required to enable huge pages on newer versions of Windows 10. -
Add debug_io_direct setting for developer usage.
While primarily for developers, wal_sync_method=open_sync/ open_datasync has been modified to not use direct I/O with wal_level=minimal; this is now enabled with debug_io_direct=wal. -
Add function pg_split_walfile_name() to report the segment and timeline values of WAL file names.
qhb_hba.conf
See Section The qhb_hba.conf File for details.
-
Add support for regular expression matching on database and role entries in qhb_hba.conf.
Regular expression patterns are prefixed with a slash. Database and role names that begin with slashes need to be double-quoted if referenced in qhb_hba.conf. -
Improve user-column handling of qhb_ident.conf to match qhb_hba.conf.
Specifically, add support for all, role membership with +, and regular expressions with a leading slash. Any user name that matches these patterns must be double-quoted. -
Allow include files in qhb_hba.conf and qhb_ident.conf.
These are controlled by include, include_if_exists, and include_dir. System views pg_hba_file_rules and pg_ident_file_mappings now display the file name. -
Allow qhb_hba.conf tokens to be of unlimited length.
-
Add rule and map numbers to the system view pg_hba_file_rules.
Localization
See Chapter Localization for details.
-
Determine the default encoding from the locale when using ICU.
Previously the default was always UTF-8. -
Have CREATE DATABASE and CREATE COLLATION's LOCALE options, and initdb and createdb --locale options, control non-libc collation providers.
Previously they only controlled libc providers. -
Add predefined collations unicode and ucs_basic.
This only works if ICU support is enabled. -
Allow custom ICU collation rules to be created.
This is done using CREATE COLLATION's new RULES clause, as well as new options for CREATE DATABASE, createdb, and initdb. -
Allow Windows to import system locales automatically.
Previously, only ICU locales could be imported on Windows.
Logical Replication
See Chapter Logical Replication for details.
-
Allow logical decoding on standbys.
Snapshot WAL records are required for logical slot creation but cannot be created on standbys. To avoid delays, the new function pg_log_standby_snapshot() allows creation of such records. -
Add server variable to control how logical decoding publishers transfer changes and how subscribers apply them.
The variable is debug_logical_replication_streaming. -
Allow logical replication initial table synchronization to copy rows in binary format.
This is only possible for subscriptions marked as binary. -
Allow parallel application of logical replication.
The CREATE SUBSCRIPTION STREAMING option now supports parallel to enable application of large transactions by parallel workers. The number of parallel workers is controlled by the new server variable max_parallel_apply_workers_per_subscription. Wait events LogicalParallelApplyMain, LogicalParallelApplyStateChange, and LogicalApplySendData were also added. Column leader_pid was added to system view pg_stat_subscription to track parallel activity. -
Improve performance for logical replication apply without a primary key.
Specifically, REPLICA IDENTITY FULL can now use btree indexes rather than sequentially scanning the table to find matches. -
Allow logical replication subscribers to process only changes that have no origin.
This can be used to avoid replication loops. This is controlled by the newCREATE SUBSCRIPTION ... ORIGINoption. -
Perform logical replication SELECT and DML actions as the table owner.
This improves security and now requires subscription owners to be either superusers or to have SET ROLE permission on all roles owning tables in the replication set. The previous behavior of performing all operations as the subscription owner can be enabled with the subscription run_as_owner option. -
Have wal_retrieve_retry_interval operate on a per-subscription basis.
Previously the retry time was applied globally. This also adds wait events LogicalRepLauncherDSA and LogicalRepLauncherHash.
Utility Commands
-
Add EXPLAIN option GENERIC_PLAN to display the generic plan for a parameterized query.
-
Allow a COPY FROM value to map to a column's DEFAULT.
-
Allow COPY into foreign tables to add rows in batches.
This is controlled by the postgres_fdw option batch_size. -
Allow the STORAGE type to be specified by CREATE TABLE.
Previously only ALTER TABLE could control this. -
Allow truncate triggers on foreign tables.
-
Allow VACUUM and vacuumdb to only process TOAST tables.
This is accomplished by havingVACUUMturn off PROCESS_MAIN or by vacuumdb using the --no-process-main option. -
Add VACUUM options to skip or update all frozen statistics.
The options are SKIP_DATABASE_STATS and ONLY_DATABASE_STATS. -
Change REINDEX DATABASE and REINDEX SYSTEM to no longer require an argument.
Previously the database name had to be specified. -
Allow CREATE STATISTICS to generate a statistics name if none is specified.
Data Types
-
Allow non-decimal integer literals.
For example, 0x42F, 0o273, and 0b100101. -
Allow NUMERIC to process hexadecimal, octal, and binary integers of any size.
Previously only unquoted eight-byte integers were supported with these non-decimal bases. -
Allow underscores in integer and numeric constants.
This can improve readability for long strings of digits. -
Accept the spelling +infinity in datetime input.
-
Prevent the specification of epoch and infinity together with other fields in datetime strings.
-
Remove undocumented support for date input in the form YyearMmonthDday.
-
Add functions pg_input_is_valid() and pg_input_error_info() to check for type conversion.
General Queries
-
Allow subqueries in the FROM clause to omit aliases.
-
Add support for enhanced numeric literals in SQL/JSON paths.
For example, allow hexadecimal, octal, and binary integers and underscores between digits.
Functions
-
Add SQL/JSON constructors.
The new functions JSON_ARRAY(), JSON_ARRAYAGG(), JSON_OBJECT(), and JSON_OBJECTAGG() are part of the SQL standard. -
Add SQL/JSON object checks.
The IS JSON checks include checks for values, arrays, objects, scalars, and unique keys. -
Allow JSON string parsing to use vector operations.
-
Improve the handling of full text highlighting function ts_headline() for OR and NOT expressions.
-
Add functions to add, subtract, and generate timestamptz values in a specified time zone.
The functions are date_add(), date_subtract(), and generate_series(). -
Change date_trunc(unit, timestamptz, time_zone) to be an immutable function.
This allows the creation of expression indexes using this function. -
Add server variable SYSTEM_USER.
This reports the authentication method and its authenticated user. -
Add functions array_sample() and array_shuffle().
-
Add aggregate function ANY_VALUE() which returns any value from a set.
-
Add function random_normal() to supply normally-distributed random numbers.
-
Add error function erf() and its complement erfc().
-
Improve the accuracy of numeric power() for integer exponents.
-
Add XMLSERIALIZE() option INDENT to pretty-print its output.
-
Change pg_collation_actual_version() to return a reasonable value for the default collation.
Previously it returned NULL. -
Allow pg_read_file() and pg_read_binary_file() to ignore missing files.
-
Add byte specification (B) to pg_size_bytes().
-
Allow to_reg* functions to accept numeric OIDs as input.
PL/pgSQL
See Chapter PL/pgSQL — SQL Procedural Language for details.
- Add the ability to get the current function's OID in PL/pgSQL.
This is accomplished with GET DIAGNOSTICS variable = PG_ROUTINE_OID.
libpq
See Chapter libpq — C Library for details.
-
Add libpq connection option require_auth to specify a list of acceptable authentication methods.
This can also be used to disallow certain authentication methods. -
Allow multiple libpq-specified hosts to be randomly selected.
This is enabled with load_balance_hosts=random and can be used for load balancing. -
Add libpq option sslcertmode to control transmission of the client certificate.
The option values are disable, allow, and require. -
Allow libpq to use the system certificate pool for certificate verification.
This is enabled with sslrootcert=system, which also enables sslmode=verify-full.
Client Applications
- Allow ECPG variable declarations to use typedef names that match unreserved SQL
keywords.
This change does prevent keywords which match C typedef names from being processed as keywords in later EXEC SQL blocks.
psql
See psql reference page for details.
-
Allow psql to control the maximum width of header lines in expanded format.
This is controlled by xheader_width. -
Add psql command \drg to show role membership details.
The Member of output column has been removed from\duand\dgbecause this new command displays this information in more detail. -
Allow psql's access privilege commands to show system objects.
The options are \dpS and \zS. -
Add FOREIGN designation to psql \d+ for foreign table children and partitions.
-
Prevent \df+ from showing function source code.
Function bodies are more easily viewed with \sf. -
Allow psql to submit queries using the extended query protocol.
Passing arguments to such queries is done using the new psql \bind command. -
Allow psql \watch to limit the number of executions.
The\watchoptions can now be named when specified. -
Detect invalid values for psql \watch, and allow zero to specify no delay.
-
Allow psql scripts to obtain the exit status of shell commands and queries.
The new psql control variables are SHELL_ERROR and SHELL_EXIT_CODE. -
Various psql tab completion improvements.
qhb_dump
See qhb_dump reference page for details.
-
Add qhb_dump control of dumping child tables and partitions.
The new options are --table-and-children, --exclude-table-and-children, and --exclude-table-data-and-children. -
Add LZ4 and Zstandard compression to qhb_dump.
-
Allow qhb_dump and qhb_basebackup to use long mode for compression.
-
Improve qhb_dump to accept a more consistent compression syntax.
Options like --compress=gzip:5.
Server Applications
-
Add initdb option to set server variables for the duration of initdb and all future server starts.
The option is -c name=value. -
Add options to createuser to control more user options.
Specifically, the new options control the valid-until date, bypassing of row-level security, and role membership. -
Deprecate createuser option --role.
This option could be easily confused with new createuser role membership options, so option --member-of has been added with the same functionality. The --role option can still be used. -
Allow control of vacuumdb schema processing.
These are controlled by options --schema and --exclude-schema. -
Use new VACUUM options to improve the performance of vacuumdb.
-
Have qhb_upgrade set the new cluster's locale and encoding.
This removes the requirement that the new cluster be created with the same locale and encoding settings. -
Add qhb_upgrade option to specify the default transfer mode.
The option is --copy. -
Improve qhb_basebackup to accept numeric compression options.
Options like --compress=server-5 are now supported. -
Fix qhb_basebackup to handle tablespaces stored in the PGDATA directory.
-
Add qhb_waldump option --save-fullpage to dump full page images.
-
Allow qhb_waldump options -t/--timeline to accept hexadecimal values.
-
Add support for progress reporting to qhb_verifybackup.
-
Allow qhb_rewind to properly track timeline changes.
Previously if qhb_rewind was run after a timeline switch but before a checkpoint was issued, it might incorrectly determine that a rewind was unnecessary. -
Have qhb_receivewal and qhb_recvlogical cleanly exit on SIGTERM.
This signal is often used by systemd.
Source Code
-
Build ICU support by default.
This removes build flag --with-icu and adds flag --without-icu. -
Add support for SSE2 (Streaming SIMD Extensions 2) vector operations on x86-64 architectures.
-
Add support for Advanced SIMD (Single Instruction Multiple Data) (NEON) instructions on ARM architectures.
-
Have Windows binaries built with MSVC use RandomizedBaseAddress (ASLR).
This was already enabled on MinGW builds. -
Prevent extension libraries from exporting their symbols by default.
Functions that need to be called from the core backend or other extensions must now be explicitly marked PGDLLEXPORT. -
Require Windows 10 or newer versions.
Previously Windows Vista and Windows XP were supported. -
Require Perl version 5.14 or later.
-
Require Bison version 2.3 or later.
-
Require Flex version 2.5.35 or later.
-
Require MIT Kerberos for GSSAPI support.
-
Remove support for Visual Studio 2013.
-
Remove support for HP-UX.
-
Remove support for HP/Intel Itanium.
-
Remove support for M68K, M88K, M32R, and SuperH CPU architectures.
-
Remove libpq support for SCM credential authentication.
Backend support for this authentication method was removed in PostgreSQL 9.1. -
Add meson build system.
This eventually will replace the Autoconf and Windows-based MSVC build systems. -
Allow control of the location of the openssl binary used by the build system.
Make finding openssl program a configure or meson option. -
Add build option to allow testing of small table segment sizes.
The build options are --with-segsize-blocks and -Dsegsize_blocks. -
Add pgindent options.
The new options are --show-diff, --silent-diff, --commit, and --help, and allow multiple --exclude options. Also require the typedef file to be explicitly specified. Options --code-base and --build were also removed. -
Add pg_bsd_indent source code to the main tree.
-
Improve
make_ctagsandmake_etags. -
Adjust pg_attribute columns for efficiency.
Additional Modules
-
Improve use of extension-based indexes on boolean columns.
-
Add support for Daitch-Mokotoff Soundex to fuzzystrmatch.
-
Allow auto_explain to log values passed to parameterized statements.
This affects queries using server-side PREPARE/EXECUTE and client-side parse/bind. Logging is controlled by auto_explain.log_parameter_max_length; by default query parameters will be logged with no length restriction. -
Have auto_explain's log_verbose mode honor the value of compute_query_id.
Previously even if compute_query_id was enabled, log_verbose was not showing the query identifier. -
Change the maximum length of ltree labels from 256 to 1000 and allow hyphens.
-
Have pg_stat_statements normalize constants used in utility commands.
Previously constants appeared instead of placeholders, e.g., $1. -
Add pg_walinspect function pg_get_wal_block_info() to report WAL block information.
-
Change how pg_walinspect functions pg_get_wal_records_info() and pg_get_wal_stats() interpret ending LSNs.
Previously ending LSNs which represent nonexistent WAL locations would generate an error, while they will now be interpreted as the end of the WAL. -
Add detailed descriptions of WAL records in pg_walinspect and qhb_waldump.
-
Add pageinspect function bt_multi_page_stats() to report statistics on multiple pages.
This is similar to bt_page_stats() except it can report on a range of pages. -
Add empty range output column to pageinspect function brin_page_items().
-
Redesign archive modules to be more flexible.
Initialization changes will require modules written for older versions of Postgres to be updated. -
Correct inaccurate pg_stat_statements row tracking extended query protocol statements.
-
Add pg_buffercache function pg_buffercache_usage_counts() to report usage totals.
-
Add pg_buffercache function pg_buffercache_summary() to report summarized buffer statistics.
-
Allow the schemas of required extensions to be referenced in extension scripts using the new syntax
@extschema:referenced_extension_name@. -
Allow required extensions to be marked as non-relocatable using no_relocate.
This allows@extschema:referenced_extension_name@to be treated as a constant for the lifetime of the extension.
postgres_fdw
See postgres_fdw reference page for details.
-
Allow postgres_fdw to do aborts in parallel.
This is enabled with postgres_fdw option parallel_abort. -
Make ANALYZE on foreign postgres_fdw tables more efficient.
The postgres_fdw option analyze_sampling controls the sampling method. -
Restrict shipment of reg* type constants in postgres_fdw to those referencing built-in objects or extensions marked as shippable.
-
Have postgres_fdw and dblink handle interrupts during connection establishment.
Release 16.9
This release contains a variety of fixes from 16.8. For information about new features in major release 16, see Section Release 16.
Changes
-
Avoid one-byte buffer overread when examining invalidly-encoded strings that are claimed to be in GB18030 encoding.
While unlikely, a SIGSEGV crash could occur if an incomplete multibyte character appeared at the end of memory. This was possible both in the server and in libpq-using applications. (CVE-2025-4207) -
Handle self-referential foreign keys on partitioned tables correctly.
Creating or attaching partitions failed to make the required catalog entries for a foreign-key constraint, if the table referenced by the constraint was the same partitioned table. This resulted in failure to enforce the constraint fully.
To fix this, you should drop and recreate any self-referential foreign keys on partitioned tables, if partitions have been created or attached since the constraint was created. Bear in mind that violating rows might already be present, in which case recreating the constraint will fail, and you'll need to fix up those rows before trying again. -
Avoid data loss when merging compressed BRIN summaries in brin_bloom_union().
The code failed to account for decompression results not being identical to the input objects, which would result in failure to add some of the data to the merged summary, leading to missed rows in index searches.
This mistake was present back to v14 where BRIN bloom indexes were introduced, but this code path was only rarely reached then. It's substantially more likely to be hit in v17 because parallel index builds now use the code. -
Fix unexpected “attribute has wrong type” errors in
UPDATE,DELETE, andMERGEqueries that use whole-row table references to views or functions in FROM. -
Fix
MERGEinto a partitioned table with DO NOTHING actions.
Some cases failed with “unknown action inMERGE WHENclause” errors. -
Prevent failure in
INSERTcommands when the table has a GENERATED column of a domain data type and the domain's constraints disallow null values.
Constraint failure was reported even if the generation expression produced a perfectly okay result. -
Correctly process references to outer CTE names that appear within a WITH clause attached to an
INSERT/UPDATE/DELETE/MERGEcommand that's inside WITH.
The parser failed to detect disallowed recursion cases, nor did it account for such references when sorting CTEs into a usable order. -
Don't try to parallelize array_agg() when the argument is of an anonymous record type.
The protocol for communicating with parallel workers doesn't support identifying the concrete record type that a worker is returning. -
Fix ARRAY(subquery) and ARRAY[expression, ...] constructs to produce sane results when the input is of type int2vector or oidvector.
This patch restores the behavior that existed before PostgreSQL 9.5: the result is of type int2vector[] or oidvector[]. -
Fix possible erroneous reports of invalid affixes while parsing Ispell dictionaries.
-
Fix
ALTER TABLE ADD COLUMNto correctly handle the case of a domain type that has a default.
If a domain type has a default, adding a column of that type (without any explicit DEFAULT clause) failed to install the domain's default value in existing rows, instead leaving the new column null. -
Repair misbehavior when there are duplicate column names in a foreign key constraint's ON DELETE SET DEFAULT or SET NULL action.
-
Improve the error message for disallowed attempts to alter the properties of a foreign key constraint.
-
Avoid error when resetting the relhassubclass flag of a temporary table that's marked ON COMMIT DELETE ROWS.
-
Add missing deparsing of the INDENT option of XMLSERIALIZE().
Previously, views or rules using XMLSERIALIZE(... INDENT) were dumped without the INDENT clause, causing incorrect results after restore. -
Avoid premature evaluation of the arguments of an aggregate function that has both FILTER and ORDER BY (or DISTINCT) options.
If there is ORDER BY or DISTINCT, we consider pre-sorting the aggregate input values rather than doing the sort within the Agg plan node. But this is problematic if the aggregate inputs include expressions that could fail (for example, a division where some of the input divisors could be zero) and there is a FILTER clause that's meant to prevent such failures. Pre-sorting would push the expression evaluations to before the FILTER test, allowing the failures to happen anyway. Avoid this by not pre-sorting if there's a FILTER and the input expressions are anything more complex than a simple Var or Const. -
Fix planner's failure to identify more than one hashable ScalarArrayOpExpr subexpression within a top-level expression.
This resulted in unnecessarily-inefficient execution of any additional subexpressions that could have been processed with a hash table (that is, IN, NOT IN, or = ANY clauses with all-constant right-hand sides). -
Disable “skip fetch” optimization in bitmap heap scan.
It turns out that this optimization can result in returning dead tuples when a concurrent vacuum marks a page all-visible. -
Fix performance issues in GIN index search startup when there are many search keys.
An indexable clause with many keys (for example,jsonbcol ?| array[...]with tens of thousands of array elements) took O(N^2) time to start up, and was uncancelable for that interval too. -
Detect missing support procedures in a BRIN index operator class, and report an error instead of crashing.
-
Respond to interrupts (such as query cancel) while waiting for asynchronous subplans of an Append plan node.
Previously, nothing would happen until one of the subplans becomes ready. -
Report the I/O statistics of active WAL senders more frequently.
Previously, the pg_stat_io view failed to accumulate I/O performed by a WAL sender until that process exited. Now such I/O will be reported after at most one second's delay. -
Fix race condition in handling of synchronous_standby_names immediately after startup.
For a short period after system startup, backends might fail to wait for synchronous commit even though synchronous_standby_names is enabled. -
Avoid infinite loop if scram_iterations is set to INT_MAX.
-
Avoid possible crashes due to double transformation of json_array()'s subquery.
-
Fix pg_strtof() to not crash with null endptr.
-
Fix crash after out-of-memory in certain GUC assignments.
-
Avoid crash when a Snowball stemmer encounters an out-of-memory condition.
-
Disallow copying of invalidated replication slots.
This prevents trouble when the invalid slot points to WAL that's already been removed. -
Disallow restoring logical replication slots on standby servers that are not in hot-standby mode.
This prevents a scenario where the slot could remain valid after promotion even if wal_level is too low. -
Prevent over-advancement of catalog_xmin in “fast forward” mode of logical decoding.
This mistake could allow deleted catalog entries to be vacuumed away even though they were still potentially needed by the WAL-reading process. -
Avoid data loss when DDL operations that don't take a strong lock affect tables that are being logically replicated.
The catalog changes caused by the DDL command were not reflected into WAL-decoding processes, allowing them to decode subsequent changes using stale catalog data, probably resulting in data corruption. -
Prevent incorrect reset of replication origin when an apply worker encounters an error but the error is caught and does not result in worker exit.
This mistake could allow duplicate data to be applied. -
Avoid duplicate snapshot creation in logical replication index lookups.
-
Improve detection of mixed-origin subscriptions.
Subscription creation gives a warning if a subscribed-to table is also being followed through other publications, since that could cause duplicate data to be received. This change improves that logic to also detect cases where a partition parent or child table is the one being followed through another publication. -
Fix wrong checkpoint details in error message about incorrect recovery timeline choice.
If the requested recovery timeline is not reachable, the reported checkpoint and timeline should be the values read from the backup_label, if there is one. This message previously reported values from the control file, which is correct when recovering from the control file without a backup_label, but not when there is a backup_label. -
Remove incorrect assertion in pgstat_report_stat().
-
Fix overly-strict assertion in gistFindCorrectParent().
-
Fix rare assertion failure in standby servers when the primary is restarted.
-
In PL/pgSQL, avoid “unexpected plan node type” error when a scrollable cursor is defined on a simple
SELECT expressionquery. -
Don't try to drop individual index partitions in qhb_dump's --clean mode.
The server rejects suchDROPcommands. That has no real consequences, since the partitions will go away anyway in the subsequentDROPs of either their parent tables or their partitioned index. However, the error reported for the attempted drop causes problems when restoring in --single-transaction mode. -
In qhb_dumpall, avoid emitting invalid role
GRANTcommands if pg_auth_members contains invalid role OIDs.
Instead, print a warning and skip the entry. This copes better with catalog corruption that has been seen to occur in back branches as a result of race conditions betweenGRANTandDROP ROLE. -
In qhb_amcheck and pg_upgrade, use the correct function to free allocations made by libpq.
These oversights could result in crashes in certain Windows build configurations, such as a debug build of libpq used by a non-debug build of the calling application. -
Allow contrib/dblink queries to be interrupted by query cancel.
This change back-patches a v17-era fix. It prevents possible hangs inCREATE DATABASEandDROP DATABASEdue to failure to detect deadlocks. -
Avoid crashing with corrupt input data in contrib/pageinspect's heap_page_items().
-
Prevent assertion failure in contrib/pg_freespacemap's pg_freespacemap().
Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check to reject that case. -
Fix build failure on macOS 15.4.
This macOS update broke our configuration probe for strchrnul(). -
Update time zone data files to tzdata release 2025b for DST law changes in Chile, plus historical corrections for Iran.
There is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago.