Stamp 17.9.
commit : 6d396980fc5aed4f1a525e0bd75cb16b25ed40ca
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 16:58:47 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 16:58:47 -0500 M configure
M configure.ac
M meson.build
Translation updates
commit : 0546d90442f7226076d474045d3a287e20325fee
author : Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 13:56:36 +0100
committer: Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 13:56:36 +0100 Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git
Source-Git-Hash: 955e432be7f4e3d1e60d9650f3f22406b0b0d497 M src/backend/po/de.po
M src/backend/po/ja.po
M src/backend/po/ru.po
M src/bin/pg_combinebackup/po/fr.po
M src/bin/pg_resetwal/po/fr.po
M src/bin/pg_rewind/po/ru.po
M src/bin/psql/po/fr.po
M src/interfaces/libpq/po/fr.po
M src/pl/plpgsql/src/po/ru.po
Release notes for 18.3, 17.9, 16.13, 15.17, 14.22.
commit : 494f9f58a8884c0308dfa7045855edec4579d27a
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Sun, 22 Feb 2026 12:22:41 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Sun, 22 Feb 2026 12:22:41 -0500 M doc/src/sgml/release-17.sgml
Fix computation of varnullingrels when translating appendrel Var
commit : bcaf1b5101c44a4549774ef047dafcbf46cfd904
author : Richard Guo <rguo@postgresql.org>
date : Fri, 20 Feb 2026 18:01:56 +0900
committer: Richard Guo <rguo@postgresql.org>
date : Fri, 20 Feb 2026 18:01:56 +0900 When adjust_appendrel_attrs translates a Var referencing a parent
relation into a Var referencing a child relation, it propagates
varnullingrels from the parent Var to the translated Var. Previously,
the code simply overwrote the translated Var's varnullingrels with
those of the parent.
This was incorrect because the translated Var might already possess
nonempty varnullingrels. This happens, for example, when a LATERAL
subquery within a UNION ALL references a Var from the nullable side of
an outer join. In such cases, the translated Var correctly carries
the outer join's relid in its varnullingrels. Overwriting these bits
with the parent Var's set caused the planner to lose track of the fact
that the Var could be nulled by that outer join.
In the reported case, because the underlying column had a NOT NULL
constraint, the planner incorrectly deduced that the Var could never
be NULL and discarded essential IS NOT NULL filters. This led to
incorrect query results where NULL rows were returned instead of being
filtered out.
To fix, use bms_add_members to merge the parent Var's varnullingrels
into the translated Var's existing set, preserving both sources of
nullability.
Back-patch to v16. Although the reported case does not seem to cause
problems in v16, leaving incorrect varnullingrels in the tree seems
like a trap for the unwary.
Bug: #19412
Reported-by: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19412-1d0318089b86859e@postgresql.org
Backpatch-through: 16 M src/backend/optimizer/util/appendinfo.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql
Update obsolete comment
commit : f4ec7154ce8d3e3a572baea682c1f58890a72589
author : Álvaro Herrera <alvherre@kurilemu.de>
date : Wed, 18 Feb 2026 18:09:54 +0100
committer: Álvaro Herrera <alvherre@kurilemu.de>
date : Wed, 18 Feb 2026 18:09:54 +0100 table_tuple_update's update_indexes argument hasn't been a boolean since
commit 19d8e2308bc5.
Backpatch-through: 16 M src/include/access/tableam.h
Fix test_valid_server_encoding helper function.
commit : c33d67fd18edec3000be0e5d12096d983e0eced5
author : Thomas Munro <tmunro@postgresql.org>
date : Tue, 17 Feb 2026 13:53:32 +1300
committer: Thomas Munro <tmunro@postgresql.org>
date : Tue, 17 Feb 2026 13:53:32 +1300 Commit c67bef3f325 introduced this test helper function for use by
src/test/regress/sql/encoding.sql, but its logic was incorrect. It
confused an encoding ID for a boolean so it gave the wrong results for
some inputs, and also forgot the usual return macro. The mistake didn't
affect values actually used in the test, so there is no change in
behavior.
Also drop it and another missed function at the end of the test, for
consistency.
Backpatch-through: 14
Author: Zsolt Parragi <zsolt.parragi@percona.com> M src/test/regress/expected/encoding.out
M src/test/regress/regress.c
M src/test/regress/sql/encoding.sql
Suppress new "may be used uninitialized" warning.
commit : 50d361f6223f8f560a7f6e36076ed333e9977a73
author : Noah Misch <noah@leadboat.com>
date : Mon, 16 Feb 2026 18:04:58 -0800
committer: Noah Misch <noah@leadboat.com>
date : Mon, 16 Feb 2026 18:04:58 -0800 Various buildfarm members, having compilers like gcc 8.5 and 6.3, fail
to deduce that text_substring() variable "E" is initialized if
slice_size!=-1. This suppression approach quiets gcc 8.5; I did not
reproduce the warning elsewhere. Back-patch to v14, like commit
9f4fd119b2cbb9a41ec0c19a8d6ec9b59b92c125.
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/1157953.1771266105@sss.pgh.pa.us
Backpatch-through: 14 M src/backend/utils/adt/varlena.c
hstore: Fix NULL pointer dereference with receive function
commit : 0dfbe42da7f75833e807e281332594e73451894b
author : Michael Paquier <michael@paquier.xyz>
date : Tue, 17 Feb 2026 08:41:32 +0900
committer: Michael Paquier <michael@paquier.xyz>
date : Tue, 17 Feb 2026 08:41:32 +0900 The receive function of hstore was not able to handle correctly
duplicate key values when a new duplicate links to a NULL value, where a
pfree() could be attempted on a NULL pointer, crashing due to a pointer
dereference.
This problem would happen for a COPY BINARY, when stacking values like
that:
aa => 5
aa => null
The second key/value pair is discarded and pfree() calls are attempted
on its key and its value, leading to a pointer dereference for the value
part as the value is NULL. The first key/value pair takes priority when
a duplicate is found.
Per offline report.
Reported-by: "Anemone" <vergissmeinnichtzh@gmail.com>
Reported-by: "A1ex" <alex000young@gmail.com>
Backpatch-through: 14 M contrib/hstore/hstore_io.c
Don't reset 'latest_page_number' when replaying multixid truncation
commit : 4a36c89f1657e0c159a1dcef18f5da4f2cc9348f
author : Heikki Linnakangas <heikki.linnakangas@iki.fi>
date : Mon, 16 Feb 2026 17:16:59 +0200
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>
date : Mon, 16 Feb 2026 17:16:59 +0200 'latest_page_number' is set to the correct value, according to
nextOffset, early at system startup. Contrary to the comment, it hence
should be set up correctly by the time we get to WAL replay.
This fixes a failure to replay WAL generated on older minor versions,
before commit 789d65364c (18.2, 17.8, 16.12, 15.16, 14.21). The
failure occurs after a truncation record has been replayed and looks
like this:
FATAL: could not access status of transaction 858112
DETAIL: Could not read from file "pg_multixact/offsets/000D" at offset 24576: read too few bytes.
CONTEXT: WAL redo at 3/2A3AB408 for MultiXact/CREATE_ID: 858111 offset 6695072 nmembers 5: 1048228 (sh) 1048271 (keysh) 1048316 (sh) 1048344 (keysh) 1048370 (sh)
Reported-by: Sebastian Webber <sebastian@swebber.me>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://www.postgresql.org/message-id/20260214090150.GC2297@p46.dedyn.io;lightning.p46.dedyn.io
Backpatch-through: 14-18 M src/backend/access/transam/multixact.c
M src/include/access/slru.h
pgcrypto: Tweak error message for incorrect session key length
commit : 74b993a000f390afc4a27e08f365d14812df8d4f
author : Michael Paquier <michael@paquier.xyz>
date : Mon, 16 Feb 2026 12:18:30 +0900
committer: Michael Paquier <michael@paquier.xyz>
date : Mon, 16 Feb 2026 12:18:30 +0900 The error message added in 379695d3cc70 referred to the public key being
too long. This is confusing as it is in fact the session key included
in a PGP message which is too long. This is harmless, but let's be
precise about what is wrong.
Per offline report.
Reported-by: Zsolt Parragi <zsolt.parragi@percona.com>
Backpatch-through: 14 M contrib/pgcrypto/expected/pgp-pubkey-session.out
M contrib/pgcrypto/px.c
Fix SUBSTRING() for toasted multibyte characters.
commit : 5d5232bc38d36a30b569396f15e5a22cd6ee529b
author : Noah Misch <noah@leadboat.com>
date : Sat, 14 Feb 2026 12:16:16 -0800
committer: Noah Misch <noah@leadboat.com>
date : Sat, 14 Feb 2026 12:16:16 -0800 Commit 1e7fe06c10c0a8da9dd6261a6be8d405dc17c728 changed
pg_mbstrlen_with_len() to ereport(ERROR) if the input ends in an
incomplete character. Most callers want that. text_substring() does
not. It detoasts the most bytes it could possibly need to get the
requested number of characters. For example, to extract up to 2 chars
from UTF8, it needs to detoast 8 bytes. In a string of 3-byte UTF8
chars, 8 bytes spans 2 complete chars and 1 partial char.
Fix this by replacing this pg_mbstrlen_with_len() call with a string
traversal that differs by stopping upon finding as many chars as the
substring could need. This also makes SUBSTRING() stop raising an
encoding error if the incomplete char is past the end of the substring.
This is consistent with the general philosophy of the above commit,
which was to raise errors on a just-in-time basis. Before the above
commit, SUBSTRING() never raised an encoding error.
SUBSTRING() has long been detoasting enough for one more char than
needed, because it did not distinguish exclusive and inclusive end
position. For avoidance of doubt, stop detoasting extra.
Back-patch to v14, like the above commit. For applications using
SUBSTRING() on non-ASCII column values, consider applying this to your
copy of any of the February 12, 2026 releases.
Reported-by: SATŌ Kentarō <ranvis@gmail.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Bug: #19406
Discussion: https://postgr.es/m/19406-9867fddddd724fca@postgresql.org
Backpatch-through: 14 M src/backend/utils/adt/varlena.c
M src/test/regress/expected/encoding.out
M src/test/regress/sql/encoding.sql
pg_mblen_range, pg_mblen_with_len: Valgrind after encoding ereport.
commit : 8e73530f1546ff6a052786845fce689b70ec2909
author : Noah Misch <noah@leadboat.com>
date : Sat, 14 Feb 2026 12:16:16 -0800
committer: Noah Misch <noah@leadboat.com>
date : Sat, 14 Feb 2026 12:16:16 -0800 The prior order caused spurious Valgrind errors. They're spurious
because the ereport(ERROR) non-local exit discards the pointer in
question. pg_mblen_cstr() ordered the checks correctly, but these other
two did not. Back-patch to v14, like commit
1e7fe06c10c0a8da9dd6261a6be8d405dc17c728.
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/20260214053821.fa.noahmisch@microsoft.com
Backpatch-through: 14 M src/backend/utils/mb/mbutils.c
Fix plpgsql's handling of "return simple_record_variable".
commit : dfd85098030475dbc38abe623f852d3aa1e1a40b
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Wed, 11 Feb 2026 16:53:14 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Wed, 11 Feb 2026 16:53:14 -0500 If the variable's value is null, exec_stmt_return() missed filling
in estate->rettype. This is a pretty old bug, but we'd managed not
to notice because that value isn't consulted for a null result ...
unless we have to cast it to a domain. That case led to a failure
with "cache lookup failed for type 0".
The correct way to assign the data type is known by exec_eval_datum.
While we could copy-and-paste that logic, it seems like a better
idea to just invoke exec_eval_datum, as the ROW case already does.
Reported-by: Pavel Stehule <pavel.stehule@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAFj8pRBT_ahexDf-zT-cyH8bMR_qcySKM8D5nv5MvTWPiatYGA@mail.gmail.com
Backpatch-through: 14 M src/pl/plpgsql/src/expected/plpgsql_domain.out
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/sql/plpgsql_domain.sql
Fix pg_stat_get_backend_wait_event() for aux processes
commit : 84247333792ce03c69659104b5ff68354a2c88f7
author : Heikki Linnakangas <heikki.linnakangas@iki.fi>
date : Wed, 11 Feb 2026 18:50:57 +0200
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>
date : Wed, 11 Feb 2026 18:50:57 +0200 The pg_stat_activity view shows information for aux processes, but the
pg_stat_get_backend_wait_event() and
pg_stat_get_backend_wait_event_type() functions did not. To fix, call
AuxiliaryPidGetProc(pid) if BackendPidGetProc(pid) returns NULL, like
we do in pg_stat_get_activity().
In version 17 and above, it's a little silly to use those functions
when we already have the ProcNumber at hand, but it was necessary
before v17 because the backend ID was different from ProcNumber. I
have other plans for wait_event_info on master, so it doesn't seem
worth applying a different fix on different versions now.
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://www.postgresql.org/message-id/c0320e04-6e85-4c49-80c5-27cfb3a58108@iki.fi
Backpatch-through: 14 M src/backend/utils/adt/pgstatfuncs.c
Further stabilize a postgres_fdw test case.
commit : 048a9f113d20310b19ee5ebfd513f5f87fcf516b
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Wed, 11 Feb 2026 11:03:01 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Wed, 11 Feb 2026 11:03:01 -0500 The buildfarm occasionally shows a variant row order in the output
of this UPDATE ... RETURNING, implying that the preceding INSERT
dropped one of the rows into some free space within the table rather
than appending them all at the end. It's not entirely clear why that
happens some times and not other times, but we have established that
it's affected by concurrent activity in other databases of the
cluster. In any case, the behavior is not wrong; the test is at fault
for presuming that a seqscan will give deterministic row ordering.
Add an ORDER BY atop the update to stop the buildfarm noise.
The buildfarm seems to have shown this only in v18 and master
branches, but just in case the cause is older, back-patch to
all supported branches.
Discussion: https://postgr.es/m/3866274.1770743162@sss.pgh.pa.us
Backpatch-through: 14 M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
doc: Mention all SELECT privileges required by INSERT ... ON CONFLICT.
commit : 0f7ca0d7dc97ecb50ac964aa50c4fcd9a5735556
author : Dean Rasheed <dean.a.rasheed@gmail.com>
date : Wed, 11 Feb 2026 10:52:59 +0000
committer: Dean Rasheed <dean.a.rasheed@gmail.com>
date : Wed, 11 Feb 2026 10:52:59 +0000 On the INSERT page, mention that SELECT privileges are also required
for any columns mentioned in the arbiter clause, including those
referred to by the constraint, and clarify that this applies to all
forms of ON CONFLICT, not just ON CONFLICT DO UPDATE.
Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Reviewed-by: Viktor Holmberg <v@viktorh.net>
Discussion: https://postgr.es/m/CAEZATCXGwMQ+x00YY9XYG46T0kCajH=21QaYL9Xatz0dLKii+g@mail.gmail.com
Backpatch-through: 14 M doc/src/sgml/ref/insert.sgml
doc: Clarify RLS policies applied for ON CONFLICT DO NOTHING.
commit : e323c8d320d2d603d146383832229615145299b1
author : Dean Rasheed <dean.a.rasheed@gmail.com>
date : Wed, 11 Feb 2026 10:25:06 +0000
committer: Dean Rasheed <dean.a.rasheed@gmail.com>
date : Wed, 11 Feb 2026 10:25:06 +0000 On the CREATE POLICY page, the description of per-command policies
stated that SELECT policies are applied when an INSERT has an ON
CONFLICT DO NOTHING clause. However, that is only the case if it
includes an arbiter clause, so clarify that.
While at it, also clarify the comment in the regression tests that
cover this.
Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Reviewed-by: Viktor Holmberg <v@viktorh.net>
Discussion: https://postgr.es/m/CAEZATCXGwMQ+x00YY9XYG46T0kCajH=21QaYL9Xatz0dLKii+g@mail.gmail.com
Backpatch-through: 14 M doc/src/sgml/ref/create_policy.sgml