DocumentationVersion comparison
POSTGRESQL · VERSION COMPARE
PostgreSQL 9.6.22 release changes
All features, fixes, and compatibility notes in this release, with related records from other versions.
Includes changes after the source version through the target. A major version name means its initial release.
Detect the source version from your database
Complete release changes
9.6.22
2021-05-13
9.6.22stableSupport ends 2021-11-11
Security changes
| CVE / issue | Severity | Fixed version | Selection status |
|---|---|---|---|
| CVE-2021-32028 Fix mishandling of "junk" columns in INSERT ... ON CONFLICT ... UPDATE target lists | 9.6.22 | Recorded fix | |
| CVE-2021-32027 Prevent integer overflows in array subscripting calculations | 9.6.22 | Recorded fix |
PostgreSQL 9.6.22
Migration and compatibility
A dump/restore is not required for those running 9.6.X.
However, if you are upgrading from a version earlier than 9.6.21, see Section E.4.
SecurityPrevent integer overflows in array subscripting calculations
Changes
Prevent integer overflows in array subscripting calculations (Tom Lane)
The array code previously did not complain about cases where an array's lower bound plus length overflows an integer. This resulted in later entries in the array becoming inaccessible (since their subscripts could not be written as integers), but more importantly it confused subsequent assignment operations. This could lead to memory overwrites, with ensuing crashes or unwanted data modifications. (CVE-2021-32027)
Related records (4)
- Same changePostgreSQL 13.3 · Prevent integer overflows in array subscripting calculations
- Same changePostgreSQL 12.7 · Prevent integer overflows in array subscripting calculations
- Same changePostgreSQL 11.12 · Prevent integer overflows in array subscripting calculations
- Same changePostgreSQL 10.17 · Prevent integer overflows in array subscripting calculations
SecurityFix mishandling of "junk" columns in INSERT ... ON CONFLICT ... UPDATE target lists
Changes
Fix mishandling of "junk" columns in INSERT ... ON CONFLICT ... UPDATE target lists (Tom Lane)
If the UPDATE list contains any multi-column sub-selects (which give rise to junk columns in addition to the results proper), the UPDATE path would end up storing tuples that include the values of the extra junk columns. That's fairly harmless in the short run, but if new columns are added to the table then the values would become accessible, possibly leading to malfunctions if they don't match the datatypes of the added columns.
In addition, in versions supporting cross-partition updates, a cross-partition update triggered by such a case had the reverse problem: the junk columns were removed from the target list, typically causing an immediate crash due to malfunction of the multi-column sub-select mechanism. (CVE-2021-32028)
Related records (4)
- Same changePostgreSQL 13.3 · Fix mishandling of “junk” columns in INSERT ... ON CONFLICT ... UPDATE target lists
- Same changePostgreSQL 12.7 · Fix mishandling of “junk” columns in INSERT ... ON CONFLICT ... UPDATE target lists
- Same changePostgreSQL 11.12 · Fix mishandling of “junk” columns in INSERT ... ON CONFLICT ... UPDATE target lists
- Same changePostgreSQL 10.17 · Fix mishandling of “junk” columns in INSERT ... ON CONFLICT ... UPDATE target lists
ImprovementsAllow ALTER ROLE/DATABASE ... SET to set the role, session_authorization, and temp_buffers parameters
Changes
Allow ALTER ROLE/DATABASE ... SET to set the role, session_authorization, and temp_buffers parameters (Tom Lane)
Previously, over-eager validity checks might reject these commands, even if the values would have worked when used later. This created a command ordering hazard for dump/reload and upgrade scenarios.
Related records (4)
- Same changePostgreSQL 13.3 · Allow ALTER ROLE/DATABASE ... SET to set the role, session_authorization, and temp_buffers parameters
- Same changePostgreSQL 12.7 · Allow ALTER ROLE/DATABASE ... SET to set the role, session_authorization, and temp_buffers parameters
- Same changePostgreSQL 11.12 · Allow ALTER ROLE/DATABASE ... SET to set the role, session_authorization, and temp_buffers parameters
- Same changePostgreSQL 10.17 · Allow ALTER ROLE/DATABASE ... SET to set the role, session_authorization, and temp_buffers parameters
Bug fixesFix bug with coercing the result of a COLLATE expression to a non-collatable type
Changes
Fix bug with coercing the result of a COLLATE expression to a non-collatable type (Tom Lane)
This led to a parse tree in which the COLLATE appears to be applied to a non-collatable value. While that normally has no real impact (since COLLATE has no effect at runtime), it was possible to construct views that would be rejected during dump/reload.
Related records (4)
- Same changePostgreSQL 13.3 · Fix bug with coercing the result of a COLLATE expression to a non-collatable type
- Same changePostgreSQL 12.7 · Fix bug with coercing the result of a COLLATE expression to a non-collatable type
- Same changePostgreSQL 11.12 · Fix bug with coercing the result of a COLLATE expression to a non-collatable type
- Same changePostgreSQL 10.17 · Fix bug with coercing the result of a COLLATE expression to a non-collatable type
ImprovementsDisallow calling window functions and procedures via the "fast path" wire protocol message
Changes
Disallow calling window functions and procedures via the "fast path" wire protocol message (Tom Lane)
Only plain functions are supported here. While trying to call an aggregate function failed already, calling a window function would crash, and calling a procedure would work only if the procedure did no transaction control.
Related records (4)
- Same changePostgreSQL 13.3 · Disallow calling window functions and procedures via the “fast path” wire protocol message
- Same changePostgreSQL 12.7 · Disallow calling window functions and procedures via the “fast path” wire protocol message
- Same changePostgreSQL 11.12 · Disallow calling window functions and procedures via the “fast path” wire protocol message
- Same changePostgreSQL 10.17 · Disallow calling window functions and procedures via the “fast path” wire protocol message
ImprovementsExtend pg_identify_object_as_address() to support event triggers
Changes
Extend pg_identify_object_as_address() to support event triggers (Joel Jacobson)
Related records (4)
- Same changePostgreSQL 13.3 · Extend pg_identify_object_as_address() to support event triggers
- Same changePostgreSQL 12.7 · Extend pg_identify_object_as_address() to support event triggers
- Same changePostgreSQL 11.12 · Extend pg_identify_object_as_address() to support event triggers
- Same changePostgreSQL 10.17 · Extend pg_identify_object_as_address() to support event triggers
Bug fixesFix to_char()'s handling of Roman-numeral month format codes with negative intervals
Changes
Fix to_char()'s handling of Roman-numeral month format codes with negative intervals (Julien Rouhaud)
Previously, such cases would usually cause a crash.
Related records (4)
- Same changePostgreSQL 13.3 · Fix to_char()'s handling of Roman-numeral month format codes with negative intervals
- Same changePostgreSQL 12.7 · Fix to_char()'s handling of Roman-numeral month format codes with negative intervals
- Same changePostgreSQL 11.12 · Fix to_char()'s handling of Roman-numeral month format codes with negative intervals
- Same changePostgreSQL 10.17 · Fix to_char()'s handling of Roman-numeral month format codes with negative intervals
Bug fixesFix use of uninitialized value while parsing an \{m,n\} quantifier in a BRE-mode regular expression
Changes
Fix use of uninitialized value while parsing an \{m,n\} quantifier in a BRE-mode regular expression (Tom Lane)
This error could cause the quantifier to act non-greedy, that is behave like an {m,n}? quantifier would do in full regular expressions.
Related records (4)
- Same changePostgreSQL 13.3 · Fix use of uninitialized value while parsing an \{m,n\} quantifier in a BRE-mode regular expression
- Same changePostgreSQL 12.7 · Fix use of uninitialized value while parsing an \{m,n\} quantifier in a BRE-mode regular expression
- Same changePostgreSQL 11.12 · Fix use of uninitialized value while parsing an \{m,n\} quantifier in a BRE-mode regular expression
- Same changePostgreSQL 10.17 · Fix use of uninitialized value while parsing an \{m,n\} quantifier in a BRE-mode regular expression
Bug fixesAvoid divide-by-zero when estimating selectivity of a regular expression with a very long fixed prefix
Changes
Avoid divide-by-zero when estimating selectivity of a regular expression with a very long fixed prefix (Tom Lane)
This typically led to a NaN selectivity value, causing assertion failures or strange planner behavior.
Related records (4)
- Same changePostgreSQL 13.3 · Avoid divide-by-zero when estimating selectivity of a regular expression with a very long fixed prefix
- Same changePostgreSQL 12.7 · Avoid divide-by-zero when estimating selectivity of a regular expression with a very long fixed prefix
- Same changePostgreSQL 11.12 · Avoid divide-by-zero when estimating selectivity of a regular expression with a very long fixed prefix
- Same changePostgreSQL 10.17 · Avoid divide-by-zero when estimating selectivity of a regular expression with a very long fixed prefix
Bug fixesFix access-off-the-end-of-the-table error in BRIN index bitmap scans
Changes
Fix access-off-the-end-of-the-table error in BRIN index bitmap scans (Tomas Vondra)
If the page range size used by a BRIN index isn't a power of two, there were corner cases in which a bitmap scan could try to fetch pages past the actual end of the table, leading to "could not open file" errors.
Related records (4)
- Same changePostgreSQL 13.3 · Fix access-off-the-end-of-the-table error in BRIN index bitmap scans
- Same changePostgreSQL 12.7 · Fix access-off-the-end-of-the-table error in BRIN index bitmap scans
- Same changePostgreSQL 11.12 · Fix access-off-the-end-of-the-table error in BRIN index bitmap scans
- Same changePostgreSQL 10.17 · Fix access-off-the-end-of-the-table error in BRIN index bitmap scans
ImprovementsEnsure that locks are released while shutting down a standby server's startup process
Changes
Ensure that locks are released while shutting down a standby server's startup process (Fujii Masao)
When a standby server is shut down while still in recovery, some locks might be left held. This causes assertion failures in debug builds; it's unclear whether any serious consequence could occur in production builds.
Related records (4)
- Same changePostgreSQL 13.3 · Ensure that locks are released while shutting down a standby server's startup process
- Same changePostgreSQL 12.7 · Ensure that locks are released while shutting down a standby server's startup process
- Same changePostgreSQL 11.12 · Ensure that locks are released while shutting down a standby server's startup process
- Same changePostgreSQL 10.17 · Ensure that locks are released while shutting down a standby server's startup process
ImprovementsEnsure we default to wal_sync_method = fdatasync on recent FreeBSD
Changes
Ensure we default to wal_sync_method = fdatasync on recent FreeBSD (Thomas Munro)
FreeBSD 13 supports open_datasync, which would normally become the default choice. However, it's unclear whether that is actually an improvement for Postgres, so preserve the existing default for now.
Related records (4)
- Same changePostgreSQL 13.3 · Ensure we default to wal_sync_method = fdatasync on recent FreeBSD
- Same changePostgreSQL 12.7 · Ensure we default to wal_sync_method = fdatasync on recent FreeBSD
- Same changePostgreSQL 11.12 · Ensure we default to wal_sync_method = fdatasync on recent FreeBSD
- Same changePostgreSQL 10.17 · Ensure we default to wal_sync_method = fdatasync on recent FreeBSD
ImprovementsEnsure we finish cleaning up when interrupted while detaching a DSM segment
Changes
Ensure we finish cleaning up when interrupted while detaching a DSM segment (Thomas Munro)
This error could result in temporary files not being cleaned up promptly after a parallel query.
Related records (4)
- Same changePostgreSQL 13.3 · Ensure we finish cleaning up when interrupted while detaching a DSM segment
- Same changePostgreSQL 12.7 · Ensure we finish cleaning up when interrupted while detaching a DSM segment
- Same changePostgreSQL 11.12 · Ensure we finish cleaning up when interrupted while detaching a DSM segment
- Same changePostgreSQL 10.17 · Ensure we finish cleaning up when interrupted while detaching a DSM segment
Bug fixesFix assorted minor memory leaks in the server
Changes
Fix assorted minor memory leaks in the server (Tom Lane, Andres Freund)
Related records (4)
- Related commitsPostgreSQL 13.3 · Fix assorted minor memory leaks in the server
- Related commitsPostgreSQL 12.7 · Fix assorted minor memory leaks in the server
- Related commitsPostgreSQL 11.12 · Fix assorted minor memory leaks in the server
- Related commitsPostgreSQL 10.17 · Fix assorted minor memory leaks in the server
Bug fixesPrevent infinite loop in libpq if a ParameterDescription message with a corrupt length is received
Changes
Prevent infinite loop in libpq if a ParameterDescription message with a corrupt length is received (Tom Lane)
Related records (4)
- Same changePostgreSQL 13.3 · Prevent infinite loop in libpq if a ParameterDescription message with a corrupt length is received
- Same changePostgreSQL 12.7 · Prevent infinite loop in libpq if a ParameterDescription message with a corrupt length is received
- Same changePostgreSQL 11.12 · Prevent infinite loop in libpq if a ParameterDescription message with a corrupt length is received
- Same changePostgreSQL 10.17 · Prevent infinite loop in libpq if a ParameterDescription message with a corrupt length is received
Bug fixesFix psql to restore the previous behavior of \connect service=something
Changes
Fix psql to restore the previous behavior of \connect service=something (Tom Lane)
A previous bug fix caused environment variables (such as PGPORT) to override entries in the service file in this context. Restore the previous behavior, in which the priority is the other way around.
Related records (4)
- Same changePostgreSQL 13.3 · Fix psql to restore the previous behavior of \connect service=something
- Same changePostgreSQL 12.7 · Fix psql to restore the previous behavior of \connect service=something
- Same changePostgreSQL 11.12 · Fix psql to restore the previous behavior of \connect service=something
- Same changePostgreSQL 10.17 · Fix psql to restore the previous behavior of \connect service=something
Bug fixesFix race condition in detection of file modification by psql's \e and related commands
Changes
Fix race condition in detection of file modification by psql's \e and related commands (Laurenz Albe)
A very fast typist could fool the code's file-timestamp-based detection of whether the temporary edit file was changed.
Related records (4)
- Same changePostgreSQL 13.3 · Fix race condition in detection of file modification by psql's \e and related commands
- Same changePostgreSQL 12.7 · Fix race condition in detection of file modification by psql's \e and related commands
- Same changePostgreSQL 11.12 · Fix race condition in detection of file modification by psql's \e and related commands
- Same changePostgreSQL 10.17 · Fix race condition in detection of file modification by psql's \e and related commands
Bug fixesFix missed file version check in pg_restore
Changes
Fix missed file version check in pg_restore (Tom Lane)
When reading a custom-format archive from a non-seekable source, pg_restore neglected to check the archive version. If it was fed a newer archive version than it can support, it would fail messily later on.
Related records (4)
ImprovementsAdd some more checks to pg_upgrade for user tables containing non-upgradable data types
Changes
Add some more checks to pg_upgrade for user tables containing non-upgradable data types (Tom Lane)
Fix detection of some cases where a non-upgradable data type is embedded within a container type (such as an array or range). Also disallow upgrading when user tables contain columns of system-defined composite types, since those types' OIDs are not stable across versions.
Related records (4)
- Same changePostgreSQL 13.3 · Add some more checks to pg_upgrade for user tables containing non-upgradable data types
- Same changePostgreSQL 12.7 · Add some more checks to pg_upgrade for user tables containing non-upgradable data types
- Same changePostgreSQL 11.12 · Add some more checks to pg_upgrade for user tables containing non-upgradable data types
- Same changePostgreSQL 10.17 · Add some more checks to pg_upgrade for user tables containing non-upgradable data types
Bug fixesFix pg_waldump to count XACT records correctly when generating per-record statistics
Changes
Fix pg_waldump to count XACT records correctly when generating per-record statistics (Kyotaro Horiguchi)
Related records (4)
- Same changePostgreSQL 13.3 · Fix pg_waldump to count XACT records correctly when generating per-record statistics
- Same changePostgreSQL 12.7 · Fix pg_waldump to count XACT records correctly when generating per-record statistics
- Same changePostgreSQL 11.12 · Fix pg_waldump to count XACT records correctly when generating per-record statistics
- Same changePostgreSQL 10.17 · Fix pg_waldump to count XACT records correctly when generating per-record statistics
Bug fixesFix contrib/amcheck to not complain about the tuple flags HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED both being set
Changes
Fix contrib/amcheck to not complain about the tuple flags HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED both being set (Julien Rouhaud)
This is a valid state after SELECT FOR UPDATE.
Related records (4)
- Same changePostgreSQL 13.3 · Fix contrib/amcheck to not complain about the tuple flags HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED both being set
- Same changePostgreSQL 12.7 · Fix contrib/amcheck to not complain about the tuple flags HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED both being set
- Same changePostgreSQL 11.12 · Fix contrib/amcheck to not complain about the tuple flags HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED both being set
- Same changePostgreSQL 10.17 · Fix contrib/amcheck to not complain about the tuple flags HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED both being set
ImprovementsAdjust VPATH build rules to support recent Oracle Developer Studio compiler versions
Changes
Adjust VPATH build rules to support recent Oracle Developer Studio compiler versions (Noah Misch)
Related records (4)
- Same changePostgreSQL 13.3 · Adjust VPATH build rules to support recent Oracle Developer Studio compiler versions
- Same changePostgreSQL 12.7 · Adjust VPATH build rules to support recent Oracle Developer Studio compiler versions
- Same changePostgreSQL 11.12 · Adjust VPATH build rules to support recent Oracle Developer Studio compiler versions
- Same changePostgreSQL 10.17 · Adjust VPATH build rules to support recent Oracle Developer Studio compiler versions
Bug fixesFix testing of PL/Python for Python 3 on Solaris
Changes
Fix testing of PL/Python for Python 3 on Solaris (Noah Misch)
Related records (4)
- Same changePostgreSQL 13.3 · Fix testing of PL/Python for Python 3 on Solaris
- Same changePostgreSQL 12.7 · Fix testing of PL/Python for Python 3 on Solaris
- Same changePostgreSQL 11.12 · Fix testing of PL/Python for Python 3 on Solaris
- Same changePostgreSQL 10.17 · Fix testing of PL/Python for Python 3 on Solaris
No matching changes
Try another search, or .
How is this comparison generated?
The comparison follows PostgreSQL release notes from just after the source through the target version. Confirmed backport duplicates are merged conservatively, with every original explanation retained. Related commits can represent independent changes; they remain separate records.
Release snapshot: 2026-11-19 · Security snapshot: 2026-09-26
Content comes from PostgreSQL release notes. Interaction inspired by pgversions.com and pgversionreport.