VersionDrift
Product

PostgreSQL 16.3 → 16.8

5 releases · 2 breaking changes · 11 security fixes · 5 advisories fixed

11security2breaking0deprecated15feature75fix

Vulnerabilities fixed by this upgrade

  • 3.1 CVE-2024-10977 Client use of server error message in PostgreSQL allows a server not trusted under current SSL or GSS settings to furnish arbitrary non-NUL bytes to the libpq application. For example, a man-in-th…
  • 4.2 CVE-2024-10978 Incorrect privilege assignment in PostgreSQL allows a less-privileged application user to view or change different rows from those intended. An attack requires the application to use SET ROLE, SET…
  • 8.8 CVE-2024-10979 Incorrect control of environment variables in PostgreSQL PL/Perl allows an unprivileged database user to change sensitive process environment variables (e.g. PATH). That often suffices to enable a…
  • 4.2 CVE-2024-10976 Incomplete tracking in PostgreSQL of tables with row security allows a reused query to view or change different rows from those intended. CVE-2023-2455 and CVE-2016-2193 fixed most interaction bet…
  • 8.8 CVE-2024-7348 Time-of-check Time-of-use (TOCTOU) race condition in pg_dump in PostgreSQL allows an object creator to execute arbitrary SQL functions as the user running pg_dump, which is often a superuser. The a…

Breaking changes

  • breaking Fix cases where a logical replication slot's restart_lsn could go backwards (Masahiko Sawada) Previously, restarting logical replication could sometimes cause the slot's restart point to be recomputed as an older value than had previously been advertised in pg_replication_slots. This is bad, since… in 16.6
  • breaking Fix race condition in COMMIT PREPARED that resulted in orphaned 2PC files (wuchengwen) A concurrent PREPARE TRANSACTION could cause COMMIT PREPARED to not remove the on-disk two-phase state file for the completed transaction. There was no immediate ill effect, but a subsequent crash-and-recovery… in 16.5

Security changes

  • security Improve behavior of libpq's quoting functions (Andres Freund, Tom Lane) The changes made for CVE-2025-1094 had one serious oversight: PQescapeLiteral() and PQescapeIdentifier() failed to honor their string length parameter, instead always reading to the input string's trailing null. This resulted… in 16.8
  • security Harden PQescapeString and allied functions against invalidly-encoded input strings (Andres Freund, Noah Misch) Data-quoting functions supplied by libpq now fully check the encoding validity of their input. If invalid characters are detected, they report an error if possible. For the ones that lack… in 16.7
  • security Fix cases where an operator family member operator or support procedure could become a dangling reference (Tom Lane) In some cases a data type could be dropped while references to its OID still remain in pg_amop or pg_amproc. While that caused no immediate issues, an attempt to drop the owning… in 16.7
  • security Use SQL-standard function bodies in the declarations of contrib/earthdistance's SQL-language functions (Tom Lane, Ronan Dunklau) This change allows their references to contrib/cube to be resolved during extension creation, reducing the risk of search-path-based failures and possible attacks. In… in 16.7
  • security Restore functionality of ALTER {ROLE|DATABASE} SET role (Tom Lane, Noah Misch) The fix for CVE-2024-10978 accidentally caused settings for role to not be applied if they come from non-interactive sources, including previous ALTER {ROLE|DATABASE} commands and the PGOPTIONS environment variable. in 16.6
  • security Ensure cached plans are marked as dependent on the calling role when RLS applies to a non-top-level table reference (Nathan Bossart) If a CTE, subquery, sublink, security invoker view, or coercion projection in a query references a table with row-level security policies, we neglected to mark the… in 16.5
  • security Make libpq discard error messages received during SSL or GSS protocol negotiation (Jacob Champion) An error message received before encryption negotiation is completed might have been injected by a man-in-the-middle, rather than being real server output. Reporting it opens the door to various… in 16.5
  • security Fix unintended interactions between SET SESSION AUTHORIZATION and SET ROLE (Tom Lane) The SQL standard mandates that SET SESSION AUTHORIZATION have a side-effect of doing SET ROLE NONE. Our implementation of that was flawed, creating more interaction between the two settings than intended.… in 16.5
  • security Prevent trusted PL/Perl code from changing environment variables (Andrew Dunstan, Noah Misch) The ability to manipulate process environment variables such as PATH gives an attacker opportunities to execute arbitrary code. Therefore, “trusted” PLs must not offer the ability to do that. To fix… in 16.5
  • security Prevent unauthorized code execution during pg_dump (Masahiko Sawada) An attacker able to create and drop non-temporary objects could inject SQL code that would be executed by a concurrent pg_dump session with the privileges of the role running pg_dump (which is often a superuser). The attack… in 16.4
  • security Detect another integer overflow case while computing new array dimensions (Joseph Koshakow) Reject applying array dimensions [-2147483648:2147483647] to an empty array. This is closely related to CVE-2023-5869, but appears harmless since the array still ends up empty. in 16.4

Every release in between

16.8 Feb 20, 2025 Release notes ↗
securityImprove behavior of libpq's quoting functions (Andres Freund, Tom Lane) The changes made for CVE-2025-1094 had one serious oversight: PQescapeLiteral() and PQescapeIdentifier() failed to honor their string length parameter, instead always reading to the input string's trailing null. This resulted…
fixFix meson build system to correctly detect availability of the bsd_auth.h system header (Nazir Bilal Yavuz)
16.7 Feb 13, 2025 Release notes ↗
securityHarden PQescapeString and allied functions against invalidly-encoded input strings (Andres Freund, Noah Misch) Data-quoting functions supplied by libpq now fully check the encoding validity of their input. If invalid characters are detected, they report an error if possible. For the ones that lack…
otherExclude parallel workers from connection privilege checks and limits (Tom Lane) Do not check datallowconn, rolcanlogin, and ACL_CONNECT privileges when starting a parallel worker, instead assuming that it's enough for the leader process to have passed similar checks originally. This avoids, for…
fixFix possible re-use of stale results in window aggregates (David Rowley) A window aggregate with a “run condition” optimization and a pass-by-reference result type might incorrectly return the result from the previous partition instead of performing a fresh calculation.
otherKeep TransactionXmin in sync with MyProc->xmin (Heikki Linnakangas) This oversight could permit a process to try to access data that had already been vacuumed away. One known consequence is transient “could not access status of transaction” errors.
fixFix race condition that could cause failure to add a newly-inserted catalog entry to a catalog cache list (Heikki Linnakangas) This could result, for example, in failure to use a newly-created function within an existing session.
otherPrevent possible catalog corruption when a system catalog is vacuumed concurrently with an update (Noah Misch)
fixFix data corruption when relation truncation fails (Thomas Munro) The filesystem calls needed to perform relation truncation could fail, leaving inconsistent state on disk (for example, effectively reviving deleted data). We can't really prevent that, but we can recover by dint of making such…
fixPrevent checkpoints from starting during relation truncation (Robert Haas) This avoids a race condition wherein the modified file might not get fsync'd before completing the checkpoint, creating a risk of data corruption if the operating system crashes soon after.
otherAvoid possibly losing an update of pg_database.datfrozenxid when VACUUM runs concurrently with a REASSIGN OWNED that changes that database's owner (Kirill Reshke)
fixFix incorrect tg_updatedcols values passed to AFTER UPDATE triggers (Tom Lane) In some cases the tg_updatedcols bitmap could describe the set of columns updated by an earlier command in the same transaction, fooling the trigger into doing the wrong thing. Also, prevent memory bloat caused by…
fixFix detach of a partition that has its own foreign-key constraint referencing a partitioned table (Amul Sul) In common cases, foreign keys are defined on a partitioned table's top level; but if instead one is defined on a partition and references a partitioned table, and the referencing partition…
fixFix mis-processing of to_timestamp's FFn format codes (Tom Lane) An integer format code immediately preceding FFn would consume all available digits, leaving none for FFn.
otherWhen deparsing an XMLTABLE() expression, ensure that XML namespace names are double-quoted when necessary (Dean Rasheed)
otherInclude the ldapscheme option in pg_hba_file_rules() output (Laurenz Albe)
featureDon't merge UNION operations if their column collations aren't consistent (Tom Lane) Previously we ignored collations when deciding if it's safe to merge UNION steps into a single N-way UNION operation. This was arguably valid before the introduction of nondeterministic collations, but it's not…
otherPrevent “wrong varnullingrels” planner errors after pulling up a subquery that's underneath an outer join (Tom Lane)
otherIgnore nulling-relation marker bits when looking up statistics (Richard Guo) This oversight could lead to failure to use relevant statistics about expressions, or to “corrupt MVNDistinct entry” errors.
fixFix missed expression processing for partition pruning steps (Tom Lane) This oversight could lead to “unrecognized node type” errors, and perhaps other problems, in queries accessing partitioned tables.
featureAllow dshash tables to grow past 1GB (Matthias van de Meent) This avoids errors like “invalid DSA memory alloc request size”. The case can occur for example in transactions that process several million tables.
otherAvoid possible integer overflow in bringetbitmap() (James Hunter, Evgeniy Gorbanyov) Since the result is only used for statistical purposes, the effects of this error were mostly cosmetic.
otherEnsure that an already-set process latch doesn't prevent the postmaster from noticing socket events (Thomas Munro) An extremely heavy workload of backends launching workers and workers exiting could prevent the postmaster from responding to incoming client connections in a timely fashion.
otherPrevent streaming standby servers from looping infinitely when reading a WAL record that crosses pages (Kyotaro Horiguchi, Alexander Kukushkin) This would happen when the record's continuation is on a page that needs to be read from a different WAL source.
fixFix unintended promotion of FATAL errors to PANIC during early process startup (Noah Misch) This fixes some unlikely cases that would result in “PANIC: proc_exit() called in child process”.
securityFix cases where an operator family member operator or support procedure could become a dangling reference (Tom Lane) In some cases a data type could be dropped while references to its OID still remain in pg_amop or pg_amproc. While that caused no immediate issues, an attempt to drop the owning…
fixFix multiple memory leaks in logical decoding output (Vignesh C, Masahiko Sawada, Boyu Yang)
fixFix small memory leak when updating the application_name or cluster_name settings (Tofig Aliev)
fixFix unsafe order of operations during cache lookups (Noah Misch) The only known consequence was a usually-harmless “you don't own a lock of type ExclusiveLock” warning during GRANT TABLESPACE.
fixFix possible “failed to resolve name” failures when using JIT on older ARM platforms (Thomas Munro) This could occur as a consequence of inconsistency about the default setting of -moutline-atomics between gcc and clang. At least Debian and Ubuntu are known to ship gcc and clang compilers that…
fixFix assertion failure in WITH RECURSIVE ... UNION queries (David Rowley)
fixFix assertion failure at shutdown when writing out the statistics file (Michael Paquier)
fixFix PL/Tcl to compile with Tcl 9 (Peter Eisentraut)
fixFix psql to safely handle file path names that are encoded in SJIS (Tom Lane) Some two-byte characters in SJIS have a second byte that is equal to ASCII backslash (\). These characters were corrupted by path name normalization, preventing access to files whose names include such characters.
fixFix use of wrong version of pqsignal() in pgbench and psql (Fujii Masao, Tom Lane) This error could lead to misbehavior when using the -T option in pgbench or the \watch command in psql, due to interrupted system calls not being resumed as expected.
fixFix misexecution of some nested \if constructs in pgbench (Michail Nikolaev) An \if command appearing within a false (not-being-executed) \if branch was incorrectly treated the same as \elif.
fixFix possible crash in pg_dump with identity sequences attached to tables that are extension members (Tom Lane)
fixFix memory leak in pg_restore with zstd-compressed data (Tom Lane) The leak was per-decompression-operation, so would be most noticeable with a dump containing many tables or large objects.
fixFix pg_basebackup to correctly handle pg_wal.tar files exceeding 2GB on Windows (Davinder Singh, Thomas Munro)
securityUse SQL-standard function bodies in the declarations of contrib/earthdistance's SQL-language functions (Tom Lane, Ronan Dunklau) This change allows their references to contrib/cube to be resolved during extension creation, reducing the risk of search-path-based failures and possible attacks. In…
fixFix meson build system to support old OpenSSL libraries on Windows (Darek Slusarczyk) Add support for the legacy library names ssleay32 and libeay32.
fixFix meson configuration process to correctly detect OSSP's uuid.h header file under MSVC (Andrew Dunstan)
+15 more items in the release notes
16.6 Nov 21, 2024 Release notes ↗
otherRepair ABI break for extensions that work with struct ResultRelInfo (Tom Lane) Last week's minor releases unintentionally broke binary compatibility with timescaledb and several other extensions. Restore the affected structure to its previous size, so that such extensions need not be rebuilt.
securityRestore functionality of ALTER {ROLE|DATABASE} SET role (Tom Lane, Noah Misch) The fix for CVE-2024-10978 accidentally caused settings for role to not be applied if they come from non-interactive sources, including previous ALTER {ROLE|DATABASE} commands and the PGOPTIONS environment variable.
breakingFix cases where a logical replication slot's restart_lsn could go backwards (Masahiko Sawada) Previously, restarting logical replication could sometimes cause the slot's restart point to be recomputed as an older value than had previously been advertised in pg_replication_slots. This is bad, since…
otherAvoid deleting still-needed WAL files during pg_rewind (Polina Bungina, Alexander Kukushkin) Previously, in unlucky cases, it was possible for pg_rewind to remove important WAL files from the rewound demoted primary. In particular this happens if those files have been marked for archival (i.e.,…
fixFix race conditions associated with dropping shared statistics entries (Kyotaro Horiguchi, Michael Paquier) These bugs could lead to loss of statistics data, assertion failures, or “can only drop stats once” errors.
otherCount index scans in contrib/bloom indexes in the statistics views, such as the pg_stat_user_indexes.idx_scan counter (Masahiro Ikeda)
fixFix crash when checking to see if an index's opclass options have changed (Alexander Korotkov) Some forms of ALTER TABLE would fail if the table has an index with non-default operator class options.
fixAvoid assertion failure caused by disconnected NFA sub-graphs in regular expression parsing (Tom Lane) This bug does not appear to have any visible consequences in non-assert builds.
16.5 Nov 14, 2024 Release notes ↗
securityEnsure cached plans are marked as dependent on the calling role when RLS applies to a non-top-level table reference (Nathan Bossart) If a CTE, subquery, sublink, security invoker view, or coercion projection in a query references a table with row-level security policies, we neglected to mark the…
securityMake libpq discard error messages received during SSL or GSS protocol negotiation (Jacob Champion) An error message received before encryption negotiation is completed might have been injected by a man-in-the-middle, rather than being real server output. Reporting it opens the door to various…
securityFix unintended interactions between SET SESSION AUTHORIZATION and SET ROLE (Tom Lane) The SQL standard mandates that SET SESSION AUTHORIZATION have a side-effect of doing SET ROLE NONE. Our implementation of that was flawed, creating more interaction between the two settings than intended.…
securityPrevent trusted PL/Perl code from changing environment variables (Andrew Dunstan, Noah Misch) The ability to manipulate process environment variables such as PATH gives an attacker opportunities to execute arbitrary code. Therefore, “trusted” PLs must not offer the ability to do that. To fix…
fixFix updates of catalog state for foreign-key constraints when attaching or detaching table partitions (Jehan-Guillaume de Rorthais, Tender Wang, Álvaro Herrera) If the referenced table is partitioned, then different catalog entries are needed for a referencing table that is stand-alone versus one…
fixAvoid possible crashes and “could not open relation” errors in queries on a partitioned table occurring concurrently with a DETACH CONCURRENTLY and immediate drop of a partition (Álvaro Herrera, Kuntal Gosh)
otherDisallow ALTER TABLE ATTACH PARTITION if the table to be attached has a foreign key referencing the partitioned table (Álvaro Herrera) This arrangement is not supported, and other ways of creating it already fail.
otherDon't use partitionwise joins or grouping if the query's collation for the key column doesn't match the partition key's collation (Jian He, Webbo Han) Such plans could produce incorrect results.
fixFix possible “could not find pathkey item to sort” error when the output of a UNION ALL member query needs to be sorted, and the sort column is an expression (Andrei Lepikhov, Tom Lane)
fixFix performance regressions involving flattening of subqueries underneath outer joins that are later reduced to plain joins (Tom Lane) v16 failed to optimize some queries as well as prior versions had, because of overoptimistic simplification of query-pullup logic.
featureAllow cancellation of the second stage of index build for large hash indexes (Pavel Borisov)
fixFix assertion failure or confusing error message for COPY (query) TO ..., when the query is rewritten by a DO INSTEAD NOTIFY rule (Tender Wang, Tom Lane)
fixFix server crash when a json_objectagg() call contains a volatile function (Amit Langote)
fixFix checking of key uniqueness in JSON object constructors (Junwang Zhao, Tomas Vondra) When building an object larger than a kilobyte, it was possible to accept invalid input that includes duplicate object keys, or to falsely report that duplicate keys are present.
fixFix detection of skewed data during parallel hash join (Thomas Munro) After repartitioning the inner side of a hash join because one partition has accumulated too many tuples, we check to see if all the partition's tuples went into the same child partition, which suggests that they all have the…
featureDisallow locale names containing non-ASCII characters (Thomas Munro) This is only an issue on Windows, as such locale names are not used elsewhere. They are problematic because it's quite unclear what encoding such names are represented in (since the locale itself defines the encoding to use). In…
fixFix race condition in committing a serializable transaction (Heikki Linnakangas) Mis-processing of a recently committed transaction could lead to an assertion failure or a “could not access status of transaction” error.
breakingFix race condition in COMMIT PREPARED that resulted in orphaned 2PC files (wuchengwen) A concurrent PREPARE TRANSACTION could cause COMMIT PREPARED to not remove the on-disk two-phase state file for the completed transaction. There was no immediate ill effect, but a subsequent crash-and-recovery…
fixAvoid invalid memory accesses after skipping an invalid toast index during VACUUM FULL (Tender Wang) A list tracking yet-to-be-rebuilt indexes was not properly updated in this code path, risking assertion failures or crashes later on.
fixFix ways in which an “in place” catalog update could be lost (Noah Misch) Normal row updates write a new version of the row to preserve rollback-ability of the transaction. However, certain system catalog updates are intentionally non-transactional and are done with an in-place update of the row.…
otherReset catalog caches at end of recovery (Noah Misch) This prevents scenarios wherein an in-place catalog update could be lost due to using stale data from a catalog cache.
otherAvoid using parallel query while holding off interrupts (Francesco Degrassi, Noah Misch, Tom Lane) This situation cannot arise normally, but it can be reached with test scenarios such as using a SQL-language function as B-tree support (which would be far too slow for production usage). If it did…
featureReport the active query ID for statistics purposes at the start of processing of Bind and Execute protocol messages (Sami Imseih) This allows more of the work done in extended query protocol to be attributed to the correct query.
fixFix some whitespace issues in the result of XMLSERIALIZE(... INDENT) (Jim Jones) Fix failure to indent nodes separated by whitespace, and ensure that a trailing newline is not added.
fixFix mis-deparsing of ORDER BY lists when there is a name conflict (Tom Lane) If an ORDER BY item in SELECT is a bare identifier, the parser first seeks it as an output column name of the SELECT, for SQL92 compatibility. However, ruleutils.c expects the SQL99 interpretation where such a name is an…
fixFix “failed to find plan for subquery/CTE” errors in EXPLAIN (Richard Guo, Tom Lane) This case arose while trying to print references to fields of a RECORD-type output of a subquery when the subquery has been optimized out of the plan altogether (which is possible at least in the case that it has…
featureIgnore not-yet-defined Portals in the pg_cursors view (Tom Lane) It is possible for user-defined code that inspects this view to be called while a new cursor is being set up, and if that happens a null pointer dereference would ensue. Avoid the problem by defining the view to exclude…
fixFix incorrect output of the pg_stat_io view on 32-bit machines (Bertrand Drouvot) The stats_reset timestamp column contained garbage on such hardware.
featurePrevent mis-encoding of “trailing junk after numeric literal” error messages (Karina Litskevich) We do not allow identifiers to appear immediately following numeric literals (there must be some whitespace between). If a multibyte character immediately followed a numeric literal, the syntax error…
featureAllow adjusting the session_authorization and role settings in parallel workers (Tom Lane) Our code intends to allow modifiable server settings to be set by function SET clauses, but not otherwise within a parallel worker. SET clauses failed for these two settings, though.
fixFix behavior of stable functions called from a CALL statement's argument list, when the CALL is within a PL/pgSQL EXCEPTION block (Tom Lane) As with a similar fix in our previous quarterly releases, this case allowed such functions to be passed the wrong snapshot, causing them to see stale values…
fixFix “cache lookup failed for function” errors in edge cases in PL/pgSQL's CALL (Tom Lane)
fixFix thread safety of our fallback (non-OpenSSL) MD5 implementation on big-endian hardware (Heikki Linnakangas) Thread safety is not currently a concern in the server, but it is for libpq.
fixFix memory leak in psql during repeated use of \bind (Michael Paquier)
fixFix pg_dump's handling of identity sequences that have persistence different from their owning table's persistence (Tom Lane) Since v15, it's been possible to set an identity sequence to be LOGGED when its owning table is UNLOGGED or vice versa. However, pg_dump's method for recreating that…
featureAllow inspection of sequence relations in relevant functions of contrib/pageinspect and contrib/pgstattuple (Nathan Bossart, Ayush Vatsa) This had been allowed in the past, but it got broken during the introduction of non-default access methods for tables.
fixFix incorrect LLVM-generated code on ARM64 platforms (Thomas Munro, Anthonin Bonnefoy) When using JIT compilation on ARM platforms, the generated code could not support relocation distances exceeding 32 bits, allowing unlucky placement of generated code to cause server crashes on large-memory…
fixFix a few places that assumed that process start time (represented as a time_t) will fit into a long value (Max Johnson, Nathan Bossart) On platforms where long is 32 bits (notably Windows), this coding would fail after Y2038. Most of the failures appear only cosmetic, but notably pg_ctl start…
fixFix building with Strawberry Perl on Windows (Andrew Dunstan)
featureUpdate time zone data files to tzdata release 2024b (Tom Lane) This tzdata release changes the old System-V-compatibility zone names to duplicate the corresponding geographic zones; for example PST8PDT is now an alias for America/Los_Angeles. The main visible consequence is that for timestamps…
+14 more items in the release notes
securityPrevent unauthorized code execution during pg_dump (Masahiko Sawada) An attacker able to create and drop non-temporary objects could inject SQL code that would be executed by a concurrent pg_dump session with the privileges of the role running pg_dump (which is often a superuser). The attack…
otherAvoid incorrect results from Merge Right Anti Join plans (Richard Guo) If the inner relation is known to have unique join keys, the merge could misbehave when there are duplicated join keys in the outer relation.
otherPrevent infinite loop in VACUUM (Melanie Plageman) After a disconnected standby server with an old running transaction reconnected to the primary, it was possible for VACUUM on the primary to get confused about which tuples are removable, resulting in an infinite loop.
fixFix failure after attaching a table as a partition, if the table had previously had inheritance children (Álvaro Herrera)
fixFix ALTER TABLE DETACH PARTITION for cases involving inconsistent index-based constraints (Álvaro Herrera, Tender Wang) When a partitioned table has an index that is not associated with a constraint, but a partition has an equivalent index that is, then detaching the partition would misbehave,…
fixFix partition pruning setup during ALTER TABLE DETACH PARTITION CONCURRENTLY (Álvaro Herrera) The executor assumed that no partition could be detached between planning and execution of a query on a partitioned table. This is no longer true since the introduction of DETACH PARTITION's CONCURRENTLY…
otherCorrectly update a partitioned table's pg_class.reltuples field to zero after its last child partition is dropped (Noah Misch) The first ANALYZE on such a partitioned table must update relhassubclass as well, and that caused the reltuples update to be lost.
fixFix handling of polymorphic output arguments for procedures (Tom Lane) The SQL CALL statement did not resolve the correct data types for such arguments, leading to errors such as “cannot display a value of type anyelement”, or even outright crashes. (But CALL in PL/pgSQL worked correctly.)
fixFix behavior of stable functions called from a CALL statement's argument list (Tom Lane) If the CALL is within an atomic context (e.g. there's an outer transaction block), such functions were passed the wrong snapshot, causing them to see stale values of rows modified since the start of the outer…
fixFix input of ISO-8601 “extended” time format for types time and timetz (Tom Lane) Re-allow cases such as T12:34:56.
otherDetect integer overflow in money calculations (Joseph Koshakow) None of the arithmetic functions for the money type checked for overflow before, so they would silently give wrong answers for overflowing cases.
fixFix over-aggressive clamping of the scale argument in round(numeric) and trunc(numeric) (Dean Rasheed) These functions clamped their scale argument to +/-2000, but there are valid use-cases for it to be larger; the functions returned incorrect results in such cases. Instead clamp to the actual…
fixFix result for pg_size_pretty() when applied to the smallest possible bigint value (Joseph Koshakow)
otherPrevent pg_sequence_last_value() from failing on unlogged sequences on standby servers and on temporary sequences of other sessions (Nathan Bossart) Make it return NULL in these cases instead of throwing an error.
fixFix parsing of ignored operators in websearch_to_tsquery() (Tom Lane) Per the manual, punctuation in the input of websearch_to_tsquery() is ignored except for the special cases of dashes and quotes. However, parentheses and a few other characters appearing immediately before an or could cause or…
securityDetect another integer overflow case while computing new array dimensions (Joseph Koshakow) Reject applying array dimensions [-2147483648:2147483647] to an empty array. This is closely related to CVE-2023-5869, but appears harmless since the array still ends up empty.
fixFix unportable usage of strnxfrm() (Jeff Davis) Some code paths for non-deterministic collations could fail with errors like “pg_strnxfrm() returned unexpected result”.
featureDetect another case of a new catalog cache entry becoming stale while detoasting its fields (Noah Misch) An in-place update occurring while we expand out-of-line fields in a catalog tuple could be missed, leading to a catalog cache entry that lacks the in-place change but is not known to be stale.…
otherCorrectly check updatability of view columns targeted by INSERT ... DEFAULT (Tom Lane) If such a column is non-updatable, we should give an error reporting that. But the check was missed and then later code would report an unhelpful error such as “attribute number N not found in view targetlist”.
otherAvoid reporting an unhelpful internal error for incorrect recursive queries (Tom Lane) Rearrange the order of error checks so that we throw an on-point error when a WITH RECURSIVE query does not have a self-reference within the second arm of the UNION, but does have one self-reference in some…
otherLock owned sequences during ALTER TABLE SET LOGGED|UNLOGGED (Noah Misch) These commands change the persistence of a table's owned sequences along with the table, but they failed to acquire lock on the sequences while doing so. This could result in losing the effects of concurrent nextval() calls.
otherDon't throw an error if a queued AFTER trigger no longer exists (Tom Lane) It's possible for a transaction to execute an operation that queues a deferred AFTER trigger for later execution, and then to drop the trigger before that happens. Formerly this led to weird errors such as “could not find…
fixFix failure to remove pg_init_privs entries for column-level privileges when their table is dropped (Tom Lane) If an extension grants some column-level privileges on a table it creates, relevant catalog entries would remain behind after the extension is dropped. This was harmless until/unless the…
fixFix selection of an arbiter index for ON CONFLICT when the desired index has expressions or predicates (Tom Lane) If a query using ON CONFLICT accesses the target table through an updatable view, it could fail with “there is no unique or exclusion constraint matching the ON CONFLICT…
fixFix handling of extended statistics on expressions in CREATE TABLE LIKE STATISTICS (Tom Lane) The CREATE command failed to adjust column references in statistics expressions to the possibly-different column numbering of the new table. This resulted in invalid statistics objects that would cause…
fixFix failure to recalculate sub-queries generated from MIN() or MAX() aggregates (Tom Lane) In some cases the aggregate result computed at one row of the outer query could be re-used for later rows when it should not be. This has only been seen to happen when the outer query uses DISTINCT that is…
featureRe-forbid underscore in positional parameters (Erik Wienhold) As of v16 we allow integer literals to contain underscores. This change caused input such as $1_234 to be taken as a single token, but it did not work correctly. It seems better to revert to the original definition in which a parameter…
fixAvoid crashing when a JIT-inlined backend function throws an error (Tom Lane) The error state can include pointers into the dynamically loaded module holding the JIT-compiled code (for error location strings). In some code paths the module could get unloaded before the error report is processed,…
fixFix handling of subtransactions of prepared transactions when starting a hot standby server (Heikki Linnakangas) When starting a standby's replay at a shutdown checkpoint WAL record, transactions that had been prepared but not yet committed on the primary are correctly understood as being still in…
fixFix resource leakage in logical replication WAL sender (Hou Zhijie) The walsender process leaked memory when publishing changes to a partitioned table whose partitions have row types physically different from the partitioned table's.
featurePrevent leakage of reference counts for the shared memory block used for statistics (Anthonin Bonnefoy) A new backend process attaching to the statistics shared memory incremented its reference count, but failed to decrement the count when exiting. After 232 sessions had been created, the…
fixFix buffer overread in JSON parse error reports for incomplete byte sequences (Jacob Champion) It was possible to walk off the end of the input buffer by a few bytes when the last bytes comprise an incomplete multi-byte character. While usually harmless, in principle this could cause a crash.
fixFix PL/pgSQL's handling of integer ranges containing underscores (Erik Wienhold) As of v16 we allow integer literals to contain underscores, but PL/pgSQL failed to handle examples such as FOR i IN 1_001..1_003.
fixFix recursive RECORD-returning PL/Python functions (Tom Lane) If we recurse to a new call of the same function that passes a different column definition list (AS clause), it would fail because the inner call would overwrite the outer call's idea of what rowtype to return.
fixFix PL/Tcl's reporting of invalid list syntax in the result of a function returning tuple (Erik Wienhold, Tom Lane) Such a case could result in a crash, or in emission of misleading context information that actually refers to the previous Tcl error.
featureAllow contrib/pg_stat_statements to distinguish among utility statements appearing within SQL-language functions (Anthonin Bonnefoy) The SQL-language function executor failed to pass along the query ID that is computed for a utility (non SELECT/INSERT/UPDATE/DELETE/MERGE) statement.
featureIn contrib/postgres_fdw, do not send FETCH FIRST WITH TIES clauses to the remote server (Japin Li) The remote server might not implement this clause, or might interpret it differently than we would locally, so don't risk attempting remote execution.
fixAvoid clashing with system-provided <regex.h> headers (Thomas Munro) This fixes a compilation failure on macOS version 15 and up.
fixFix otherwise-harmless assertion failure in Memoize cost estimation (David Rowley)
fixFix otherwise-harmless assertion failures in REINDEX CONCURRENTLY applied to an SP-GiST index (Tom Lane)
+14 more items in the release notes
See how far your stack has drifted from upstream. Release data from vendors’ own sources · feed under CC BY 4.0 · Code under AGPL-3.0 Settings Feed status