Stamp 14.6.
commit : 6dde6ed3efb4baaa0955f78ba5c93e9490aaa490
author : Tom Lane <[email protected]>
date : Mon, 7 Nov 2022 16:38:53 -0500
committer: Tom Lane <[email protected]>
date : Mon, 7 Nov 2022 16:38:53 -0500
M configure
M configure.ac
Translation updates
commit : 9c5cbed95e3761d36c1b8cdf89cb1e1f1a8aca9a
author : Peter Eisentraut <[email protected]>
date : Mon, 7 Nov 2022 13:59:56 +0100
committer: Peter Eisentraut <[email protected]>
date : Mon, 7 Nov 2022 13:59:56 +0100
Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git
Source-Git-Hash: a2d024d57415123f7c9c6e7a71796c7cee8cabc6
M src/backend/po/de.po
M src/backend/po/es.po
M src/backend/po/fr.po
M src/backend/po/ja.po
M src/backend/po/ru.po
M src/backend/po/sv.po
M src/bin/initdb/po/ru.po
M src/bin/pg_amcheck/po/ru.po
M src/bin/pg_archivecleanup/po/ru.po
M src/bin/pg_basebackup/po/ru.po
M src/bin/pg_checksums/po/ru.po
M src/bin/pg_controldata/po/ru.po
M src/bin/pg_ctl/po/ja.po
M src/bin/pg_ctl/po/ru.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_resetwal/po/ru.po
M src/bin/pg_rewind/po/ru.po
M src/bin/pg_test_fsync/po/ru.po
M src/bin/pg_upgrade/po/ru.po
M src/bin/pg_upgrade/po/uk.po
M src/bin/pg_verifybackup/po/ru.po
M src/bin/pg_waldump/po/de.po
M src/bin/pg_waldump/po/es.po
M src/bin/pg_waldump/po/fr.po
M src/bin/pg_waldump/po/ru.po
M src/bin/pg_waldump/po/sv.po
M src/bin/psql/po/ru.po
M src/bin/scripts/po/ru.po
M src/interfaces/ecpg/ecpglib/po/ru.po
M src/interfaces/ecpg/preproc/po/ru.po
M src/interfaces/libpq/po/ru.po
M src/interfaces/libpq/po/uk.po
M src/pl/plperl/po/ru.po
M src/pl/plpgsql/src/po/ru.po
M src/pl/plpython/po/ru.po
M src/pl/tcl/po/ru.po
Release notes for 15.1, 14.6, 13.9, 12.13, 11.18, 10.23.
commit : e527cb8cecc70c3289b8ee1b3d62bc3631bfc8d5
author : Tom Lane <[email protected]>
date : Sun, 6 Nov 2022 11:07:28 -0500
committer: Tom Lane <[email protected]>
date : Sun, 6 Nov 2022 11:07:28 -0500
M doc/src/sgml/release-14.sgml
Correct error message for row-level triggers with transition tables on partitioned tables.
commit : 1699125ca218d4a035b794eef7c7b8872d10f527
author : Etsuro Fujita <[email protected]>
date : Fri, 4 Nov 2022 19:15:03 +0900
committer: Etsuro Fujita <[email protected]>
date : Fri, 4 Nov 2022 19:15:03 +0900
"Triggers on partitioned tables cannot have transition tables." is
incorrect as we allow statement-level triggers on partitioned tables to
have transition tables.
This has been wrong since commit 86f575948; back-patch to v11 where that
commit came in.
Reviewed by Tom Lane.
Discussion: https://postgr.es/m/CAPmGK17gk4vXLzz2iG%2BG4LWRWCoVyam70nZ3OuGm1hMJwDrhcg%40mail.gmail.com
M src/backend/commands/trigger.c
M src/test/regress/expected/triggers.out
Create FKs properly when attaching table as partition
commit : 18865f4df9ca2369f42f98d53fc0e82e38b8a41d
author : Alvaro Herrera <[email protected]>
date : Thu, 3 Nov 2022 20:40:21 +0100
committer: Alvaro Herrera <[email protected]>
date : Thu, 3 Nov 2022 20:40:21 +0100
Commit f56f8f8da6af added some code in CloneFkReferencing that's way too
lax about a Constraint node it manufactures, not initializing enough
struct members -- initially_valid in particular was forgotten. This
causes some FKs in partitions added by ALTER TABLE ATTACH PARTITION to
be marked as not validated. Set initially_valid true, which fixes the
bug.
While at it, make the struct initialization more complete. Very similar
code was added in two other places by the same commit; make them all
follow the same pattern for consistency, though no bugs are apparent
there.
This bug has never been reported: I only happened to notice while
working on commit 614a406b4ff1. The test case that was added there with
the improper result is repaired.
Backpatch to 12.
Discussion: https://postgr.es/m/[email protected]
M src/backend/commands/tablecmds.c
M src/test/regress/expected/foreign_key.out
Avoid crash after function syntax error in a replication worker.
commit : 2489c38cdc58bdd2f181651e741440bb6b83e80b
author : Tom Lane <[email protected]>
date : Thu, 3 Nov 2022 12:01:57 -0400
committer: Tom Lane <[email protected]>
date : Thu, 3 Nov 2022 12:01:57 -0400
If a syntax error occurred in a SQL-language or PL/pgSQL-language
CREATE FUNCTION or DO command executed in a logical replication worker,
we'd suffer a null pointer dereference or assertion failure. That
seems like a rather contrived case, but nonetheless worth fixing.
The cause is that function_parse_error_transpose assumes it must be
executing within the context of a Portal, but logical/worker.c
doesn't create a Portal since it's not running the standard executor.
We can just back off the hard Assert check and make it fail gracefully
if there's not an ActivePortal. (I have a feeling that the aggressive
check here was my fault originally, probably because I wasn't sure if
the case would always hold and wanted to find out. Well, now we know.)
The hazard seems to exist in all branches that have logical replication,
so back-patch to v10.
Maxim Orlov, Anton Melnikov, Masahiko Sawada, Tom Lane
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
M src/backend/catalog/pg_proc.c
Add casts to simplehash.h to silence C++ warnings.
commit : eeb5461e76ae3df40e2443c087ab94925d767434
author : Tom Lane <[email protected]>
date : Thu, 3 Nov 2022 10:47:31 -0400
committer: Tom Lane <[email protected]>
date : Thu, 3 Nov 2022 10:47:31 -0400
Casting the result of palloc etc. to the intended type is more per
project style anyway.
(The fact that cpluspluscheck doesn't notice these problems is
because it doesn't expand any macros, which seems like a troubling
shortcoming. Don't have a good idea about improving that.)
Back-patch to v13, which is as far as the patch applies cleanly;
doesn't seem worth working harder.
David Geier
Discussion: https://postgr.es/m/[email protected]
M src/include/lib/simplehash.h
Allow use of __sync_lock_test_and_set for spinlocks on any machine.
commit : 058c7b5dd4cc6d8f3561f843fe0f1a7839e2b26d
author : Tom Lane <[email protected]>
date : Wed, 2 Nov 2022 17:37:26 -0400
committer: Tom Lane <[email protected]>
date : Wed, 2 Nov 2022 17:37:26 -0400
If we have no special-case code in s_lock.h for the current platform,
but the compiler has __sync_lock_test_and_set, use that instead of
failing. It's unlikely that anybody's __sync_lock_test_and_set
would be so awful as to be worse than our semaphore-based fallback,
but if it is, they can (continue to) use --disable-spinlocks.
This allows removal of the RISC-V special case installed by commit
c32fcac56, which generated exactly the same code but only on that
platform. Usefully, the RISC-V buildfarm animals should now test
at least the int variant of this patch.
I've manually tested both variants on ARM by dint of removing the
ARM-specific stanza. We don't want to drop that, because it already
has some special knowledge and is likely to grow more over time.
Likewise, this is not meant to preclude installing special cases
for other arches if that proves worthwhile.
Per discussion of a request to install the same code for loongarch64.
Like the previous patch, we might as well back-patch to supported
branches.
Discussion: https://postgr.es/m/[email protected]
M src/include/storage/s_lock.h
Defend against unsupported partition relkind in logical replication worker.
commit : a5b7821fc908b50ace1cdc3b972da08a265a81bd
author : Tom Lane <[email protected]>
date : Wed, 2 Nov 2022 12:29:39 -0400
committer: Tom Lane <[email protected]>
date : Wed, 2 Nov 2022 12:29:39 -0400
Since partitions can be foreign tables not only plain tables, but
logical replication only supports plain tables, we'd better check the
relkind of a partition after we find it. (There was some discussion
of checking this when adding a partitioned table to a subscription;
but that would be inadequate since the troublesome partition could be
added later.) Without this, the situation leads to a segfault or
assertion failure.
In passing, add a separate variable for the target Relation of
a cross-partition UPDATE; reusing partrel seemed mighty confusing
and error-prone.
Shi Yu and Tom Lane, per report from Ilya Gladyshev. Back-patch
to v13 where logical replication into partitioned tables became
a thing.
Discussion: https://postgr.es/m/[email protected]
M src/backend/replication/logical/worker.c
Fix copy-and-pasteo in comment.
commit : 2896aa98ef569d99ea5b27cd6e7a2a789c14fd0a
author : Etsuro Fujita <[email protected]>
date : Wed, 2 Nov 2022 18:15:03 +0900
committer: Etsuro Fujita <[email protected]>
date : Wed, 2 Nov 2022 18:15:03 +0900
M src/backend/executor/nodeModifyTable.c
Update time zone data files to tzdata release 2022f.
commit : 97bb80b1b65ea25fe52c289826479018d7bcc167
author : Tom Lane <[email protected]>
date : Tue, 1 Nov 2022 17:08:28 -0400
committer: Tom Lane <[email protected]>
date : Tue, 1 Nov 2022 17:08:28 -0400
DST law changes in Chile, Fiji, Iran, Jordan, Mexico, Palestine,
and Syria. Historical corrections for Chile, Crimea, Iran, and
Mexico.
Also, the Europe/Kiev zone has been renamed to Europe/Kyiv
(retaining the old name as a link).
The following zones have been merged into nearby, more-populous zones
whose clocks have agreed since 1970: Antarctica/Vostok, Asia/Brunei,
Asia/Kuala_Lumpur, Atlantic/Reykjavik, Europe/Amsterdam,
Europe/Copenhagen, Europe/Luxembourg, Europe/Monaco, Europe/Oslo,
Europe/Stockholm, Indian/Christmas, Indian/Cocos, Indian/Kerguelen,
Indian/Mahe, Indian/Reunion, Pacific/Chuuk, Pacific/Funafuti,
Pacific/Majuro, Pacific/Pohnpei, Pacific/Wake and Pacific/Wallis.
(This indirectly affects zones that were already links to one of
these: Arctic/Longyearbyen, Atlantic/Jan_Mayen, Iceland,
Pacific/Ponape, Pacific/Truk, and Pacific/Yap.) America/Nipigon,
America/Rainy_River, America/Thunder_Bay, Europe/Uzhgorod, and
Europe/Zaporozhye were also merged into nearby zones after discovering
that their claimed post-1970 differences from those zones seem to have
been errors.
While the IANA crew have been working on merging zones that have no
post-1970 differences for some time, this batch of changes affects
some zones that are significantly more populous than those merged
in the past, notably parts of Europe. The loss of pre-1970 timezone
history for those zones may be troublesome for applications
expecting consistency of timestamptz display. As an example, the
stored value '1944-06-01 12:00 UTC' would previously display as
'1944-06-01 13:00:00+01' if the Europe/Stockholm zone is selected,
but now it will read out as '1944-06-01 14:00:00+02'.
There exists a "packrat" option that will build the timezone data
files with this old data preserved, but the problem is that it also
resurrects a bunch of other, far less well-attested data; so much so
that actually more zones' contents change from 2022a with that option
than without it. I have chosen not to do that here, for that reason
and because it appears that no major OS distributions are using the
"packrat" option, so that doing so would cause Postgres' behavior
to diverge significantly depending on whether it was built with
--with-system-tzdata. However, for anyone for whom these changes pose
significant problems, there is a solution: build a set of timezone
files with the "packrat" option and use those with Postgres.
M src/timezone/data/tzdata.zi
pg_stat_statements: fetch stmt location/length before it disappears.
commit : 0f2f5645a1f347bad7bfa4b670ce9aacdb9e634d
author : Tom Lane <[email protected]>
date : Tue, 1 Nov 2022 12:48:01 -0400
committer: Tom Lane <[email protected]>
date : Tue, 1 Nov 2022 12:48:01 -0400
When executing a utility statement, we must fetch everything
we need out of the PlannedStmt data structure before calling
standard_ProcessUtility. In certain cases (possibly only ROLLBACK
in extended query protocol), that data structure will get freed
during command execution. The situation is probably often harmless
in production builds, but in debug builds we intentionally overwrite
the freed memory with garbage, leading to picking up garbage values
of statement location and length, typically causing an assertion
failure later in pg_stat_statements. In non-debug builds, if
something did go wrong it would likely lead to storing garbage
for the query string.
Report and fix by zhaoqigui (with cosmetic adjustments by me).
It's an old problem, so back-patch to all supported versions.
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
M contrib/pg_stat_statements/pg_stat_statements.c
Fix ordering issue with WAL operations in GIN fast insert path
commit : 5a30d43fa9869adc5a6f708dd0994a8a4e53d905
author : Michael Paquier <[email protected]>
date : Wed, 26 Oct 2022 09:41:18 +0900
committer: Michael Paquier <[email protected]>
date : Wed, 26 Oct 2022 09:41:18 +0900
Contrary to what is documented in src/backend/access/transam/README,
ginHeapTupleFastInsert() had a few ordering issues with the way it does
its WAL operations when inserting items in its fast path.
First, when using a separate list, XLogBeginInsert() was being always
called before START_CRIT_SECTION(), and in this case a second thing was
wrong when merging lists, as an exclusive lock was taken on the tail
page *before* calling XLogBeginInsert(). Finally, when inserting items
into a tail page, the order of XLogBeginInsert() and
START_CRIT_SECTION() was reversed. This commit addresses all these
issues by moving the calls of XLogBeginInsert() after all the pages
logged are locked and pinned, within a critical section.
This has been applied first only on HEAD as of 56b6625, but as per
discussion with Tom Lane and Álvaro Herrera, a backpatch is preferred to
keep all the branches consistent and to respect the transam's README
where we can.
Author: Matthias van de Meent, Zhang Mingli
Discussion: https://postgr.es/m/CAEze2WhL8uLMqynnnCu1LAPwxD5RKEo0nHV+eXGg_N6ELU88HQ@mail.gmail.com
Backpatch-through: 10
M src/backend/access/gin/ginfast.c
pg_basebackup: Fix cross-platform tablespace relocation.
commit : aaad8adb02ed20ebff9b60f1778d4a80d76e77c1
author : Robert Haas <[email protected]>
date : Fri, 21 Oct 2022 08:21:55 -0400
committer: Robert Haas <[email protected]>
date : Fri, 21 Oct 2022 08:21:55 -0400
Specifically, when pg_basebackup is invoked with -Tx=y, don't error
out if x could plausibly be an absolute path either on Windows or on
non-Windows systems. We don't know whether the remote system is
running the same OS as the local system, so it's not appropriate to
assume that our local rule about absolute pathnames is the same as
the rule on the remote system.
Patch by me, reviewed by Tom Lane, Andrew Dunstan, and
Davinder Singh.
Discussion: http://postgr.es/m/CA+TgmoY+jC3YiskomvYKDPK3FbrmsDU7_8+wMHt02HOdJeRb0g@mail.gmail.com
M src/bin/pg_basebackup/pg_basebackup.c
M src/include/port.h
Add CHECK_FOR_INTERRUPTS while restoring changes during decoding.
commit : 36fc013fabd94f159553973f55afecc6cd115d60
author : Amit Kapila <[email protected]>
date : Fri, 21 Oct 2022 12:33:47 +0530
committer: Amit Kapila <[email protected]>
date : Fri, 21 Oct 2022 12:33:47 +0530
Previously in commit 42681dffaf, we added CFI during decoding changes but
missed another similar case that can happen while restoring changes
spilled to disk back into memory in a loop.
Reported-by: Robert Haas
Author: Amit Kapila
Backpatch-through: 10
Discussion: https://postgr.es/m/CA+TgmoaLObg0QbstbC8ykDwOdD1bDkr4AbPpB=0DPgA2JW0mFg@mail.gmail.com
M src/backend/replication/logical/reorderbuffer.c
Fix executing invalidation messages generated by subtransactions during decoding.
commit : 4fbe6096b954092abc460adaddd365d5049d40f1
author : Amit Kapila <[email protected]>
date : Fri, 21 Oct 2022 09:52:44 +0530
committer: Amit Kapila <[email protected]>
date : Fri, 21 Oct 2022 09:52:44 +0530
This problem has been introduced by commit 272248a0c1 where we started
assigning the subtransactions to the top-level transaction when we mark
both the top-level transaction and its subtransactions as containing
catalog changes. After we assign subtransactions to the top-level
transaction, we were not allowed to execute any invalidations associated
with it when we decide to skip the transaction.
The reason to assign the subtransactions to the top-level transaction was
to avoid the assertion failure in AssertTXNLsnOrder() as they have the
same LSN when we sometimes start accumulating transaction changes for
partial transactions after the restart. Now that with commit 64ff0fe4e8,
we skip this assertion check until we reach the LSN at which we start
decoding the contents of the transaction, so, there is no reason for such
an assignment anymore.
The assignment change was introduced in 15 and prior versions but this bug
doesn't exist in branches prior to 14 since we don't add invalidation
messages to subtransactions. We decided to backpatch through 11 for
consistency but not for 10 since its final release is near.
Reported-by: Kuroda Hayato
Author: Masahiko Sawada
Reviewed-by: Amit Kapila
Backpatch-through: 11
Discussion: https://postgr.es/m/TYAPR01MB58660803BCAA7849C8584AA4F57E9%40TYAPR01MB5866.jpnprd01.prod.outlook.com
Discussion: https://postgr.es/m/a89b46b6-0239-2fd5-71a9-b19b1f7a7145%40enterprisedb.com
M contrib/test_decoding/expected/catalog_change_snapshot.out
M contrib/test_decoding/specs/catalog_change_snapshot.spec
M src/backend/replication/logical/snapbuild.c
Doc: fix outdated wording about parallel seq scans
commit : f892150076dbee167ecd850d3628443d0fb34d82
author : David Rowley <[email protected]>
date : Fri, 21 Oct 2022 09:30:27 +1300
committer: David Rowley <[email protected]>
date : Fri, 21 Oct 2022 09:30:27 +1300
56788d215 adjusted the parallel seq scan code so that instead of handing
out a single block at a time to parallel workers, it now hands out ranges
of blocks.
Here we update the documentation which still claimed that workers received
just 1 block at a time.
Reported-by: Zhang Mingli
Discussion: https://postgr.es/m/17c99615-2c3b-4e4e-9d0b-424a66a7bccd@Spark
Backpatch-through: 14, where 56788d215 was added.
M doc/src/sgml/parallel.sgml
Fix assertion failures while processing NEW_CID record in logical decoding.
commit : a592ed923e67871749233dcd7106a64936a971cf
author : Amit Kapila <[email protected]>
date : Thu, 20 Oct 2022 09:34:18 +0530
committer: Amit Kapila <[email protected]>
date : Thu, 20 Oct 2022 09:34:18 +0530
When the logical decoding restarts from NEW_CID, since there is no
association between the top transaction and its subtransaction, both are
created as top transactions and have the same LSN. This caused the
assertion failure in AssertTXNLsnOrder().
This patch skips the assertion check until we reach the LSN at which we
start decoding the contents of the transaction, specifically
start_decoding_at LSN in SnapBuild. This is okay because we don't
guarantee to make the association between top transaction and
subtransaction until we try to decode the actual contents of transaction.
The ordering of the records prior to the start_decoding_at LSN should have
been checked before the restart.
The other assertion failure is due to the reason that we forgot to track
that we have considered top-level transaction id in the list of catalog
changing transactions that were committed when one of its subtransactions
is marked as containing catalog change.
Reported-by: Tomas Vondra, Osumi Takamichi
Author: Masahiko Sawada, Kuroda Hayato
Reviewed-by: Amit Kapila, Dilip Kumar, Kuroda Hayato, Kyotaro Horiguchi, Masahiko Sawada
Backpatch-through: 10
Discussion: https://postgr.es/m/a89b46b6-0239-2fd5-71a9-b19b1f7a7145%40enterprisedb.com
Discussion: https://postgr.es/m/TYCPR01MB83733C6CEAE47D0280814D5AED7A9%40TYCPR01MB8373.jpnprd01.prod.outlook.com
M contrib/test_decoding/expected/catalog_change_snapshot.out
M contrib/test_decoding/specs/catalog_change_snapshot.spec
M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c
Track LLVM 15 changes.
commit : d033f8f8bea9c7b5c4ae43a95b569ceccdaddd7a
author : Thomas Munro <[email protected]>
date : Wed, 19 Oct 2022 22:32:14 +1300
committer: Thomas Munro <[email protected]>
date : Wed, 19 Oct 2022 22:32:14 +1300
Per https://llvm.org/docs/OpaquePointers.html, support for non-opaque
pointers still exists and we can request that on our context. We have
until LLVM 16 to move to opaque pointers, a much larger change.
Back-patch to 11, where LLVM support arrived.
Author: Thomas Munro <[email protected]>
Author: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/CAMHz58Sf_xncdyqsekoVsNeKcruKootLtVH6cYXVhhUR1oKPCg%40mail.gmail.com
M configure
M configure.ac
M src/backend/jit/llvm/llvmjit.c
M src/backend/jit/llvm/llvmjit_inline.cpp
doc: move the mention of aggregate JSON functions up in section
commit : 51683feb97c1cd324617837bda727b19989c7b53
author : Bruce Momjian <[email protected]>
date : Mon, 17 Oct 2022 15:21:29 -0400
committer: Bruce Momjian <[email protected]>
date : Mon, 17 Oct 2022 15:21:29 -0400
It was previously easily overlooked at the end of several tables.
Reported-by: Alex Denman
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/func.sgml
doc: warn pg_stat_reset() can cause vacuum/analyze problems
commit : b661aea772e1fd06064ee9473c2431081a4436fe
author : Bruce Momjian <[email protected]>
date : Mon, 17 Oct 2022 15:07:03 -0400
committer: Bruce Momjian <[email protected]>
date : Mon, 17 Oct 2022 15:07:03 -0400
The fix is to run ANALYZE.
Discussion: https://postgr.es/m/[email protected],
https://postgr.es/m/flat/CAKJS1f8DTbCHf9gedU0He6ARsd58E6qOhEHM1caomqj_r9MOiQ%40mail.gmail.com,
https://postgr.es/m/CAKJS1f80o98hcfSk8j%3DfdN09S7Sjz%2BvuzhEwbyQqvHJb_sZw0g%40mail.gmail.com
Backpatch-through: 10
M doc/src/sgml/monitoring.sgml
Reject non-ON-SELECT rules that are named "_RETURN".
commit : 2f26cec4884366cc23737c5a9b7797935057ce38
author : Tom Lane <[email protected]>
date : Mon, 17 Oct 2022 12:14:39 -0400
committer: Tom Lane <[email protected]>
date : Mon, 17 Oct 2022 12:14:39 -0400
DefineQueryRewrite() has long required that ON SELECT rules be named
"_RETURN". But we overlooked the converse case: we should forbid
non-ON-SELECT rules that are named "_RETURN". In particular this
prevents using CREATE OR REPLACE RULE to overwrite a view's _RETURN
rule with some other kind of rule, thereby breaking the view.
Per bug #17646 from Kui Liu. Back-patch to all supported branches.
Discussion: https://postgr.es/m/[email protected]
M src/backend/rewrite/rewriteDefine.c
Guard against table-AM-less relations in planner.
commit : 8c611602bd356cbb47c3ebe8614f958391ec92a8
author : Tom Lane <[email protected]>
date : Mon, 17 Oct 2022 11:35:23 -0400
committer: Tom Lane <[email protected]>
date : Mon, 17 Oct 2022 11:35:23 -0400
The executor will dump core if it's asked to execute a seqscan on
a relation having no table AM, such as a view. While that shouldn't
really happen, it's possible to get there via catalog corruption,
such as a missing ON SELECT rule. It seems worth installing a defense
against that. There are multiple plausible places for such a defense,
but I picked the planner's get_relation_info().
Per discussion of bug #17646 from Kui Liu. Back-patch to v12 where
the tableam APIs were introduced; in older versions you won't get a
SIGSEGV, so it seems less pressing.
Discussion: https://postgr.es/m/[email protected]
M src/backend/optimizer/util/plancat.c
Fix EXPLAIN of SEARCH BREADTH FIRST with a constant initial value.
commit : 8122160ffb68acb0db740f4f6456fdaaaa577d90
author : Tom Lane <[email protected]>
date : Sun, 16 Oct 2022 19:18:08 -0400
committer: Tom Lane <[email protected]>
date : Sun, 16 Oct 2022 19:18:08 -0400
If the non-recursive term of a SEARCH BREADTH FIRST recursive
query has only constants in its target list, the planner will
fold the starting RowExpr added by rewrite into a simple Const
of type RECORD. The executor doesn't have any problem with
that --- but EXPLAIN VERBOSE will encounter the Const as the
ultimate source of truth about what the field names of the
SET column are, and it didn't know what to do with that.
Fortunately, we can pull the identifying typmod out of the
Const, in much the same way that record_out would.
For reasons that remain a bit obscure to me, this only fails
with SEARCH BREADTH FIRST, not SEARCH DEPTH FIRST or CYCLE.
But I added regression test cases for both of those options
too, just to make sure we don't break it in future.
Per bug #17644 from Matthijs van der Vleuten. Back-patch
to v14 where these constructs were added.
Discussion: https://postgr.es/m/[email protected]
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/fmgr/funcapi.c
M src/test/regress/expected/with.out
M src/test/regress/sql/with.sql
Rename parser token REF to REF_P to avoid a symbol conflict.
commit : 18e60712dd852f796bb31a64e8389d92be7cf9c6
author : Tom Lane <[email protected]>
date : Sun, 16 Oct 2022 15:27:04 -0400
committer: Tom Lane <[email protected]>
date : Sun, 16 Oct 2022 15:27:04 -0400
In the latest version of Apple's macOS SDK, <sys/socket.h>
fails to compile if "REF" is #define'd as something.
Apple may or may not agree that this is a bug, and even if
they do accept the bug report I filed, they probably won't
fix it very quickly. In the meantime, our back branches will all
fail to compile gram.y. v15 and HEAD currently escape the problem
thanks to the refactoring done in 98e93a1fc, but that's purely
accidental. Moreover, since that patch removed a widely-visible
inclusion of <netdb.h>, back-patching it seems too likely to break
third-party code.
Instead, change the token's code name to REF_P, following our usual
convention for naming parser tokens that are likely to have symbol
conflicts. The effects of that should be localized to the grammar
and immediately surrounding files, so it seems like a safer answer.
Per project policy that we want to keep recently-out-of-support
branches buildable on modern systems, back-patch all the way to 9.2.
Discussion: https://postgr.es/m/[email protected]
M src/backend/parser/gram.y
M src/include/parser/kwlist.h
Use libc's snprintf, not sprintf, for special cases in snprintf.c.
commit : 6fa431d84a046603ec7c2d54ad51955487686b20
author : Tom Lane <[email protected]>
date : Sun, 16 Oct 2022 11:47:44 -0400
committer: Tom Lane <[email protected]>
date : Sun, 16 Oct 2022 11:47:44 -0400
snprintf.c has always fallen back on libc's *printf implementation
when printing pointers (%p) and floats. When this code originated,
we were still supporting some platforms that lacked native snprintf,
so we used sprintf for that. That's not actually unsafe in our usage,
but nonetheless builds on macOS are starting to complain about sprintf
being unconditionally deprecated; and I wouldn't be surprised if other
platforms follow suit. There seems little reason to believe that any
platform supporting C99 wouldn't have standards-compliant snprintf,
so let's just use that instead to suppress such warnings.
Back-patch to v12, which is where we started to require C99. It's
also where we started to use our snprintf.c everywhere, so this
wouldn't be enough to suppress the warning in older branches anyway
--- that is, in older branches these aren't necessarily all our
usages of libc's sprintf. It is enough in v12+ because any
deprecation annotation attached to libc's sprintf won't apply to
pg_sprintf. (Whether all our usages of pg_sprintf are adequately
safe is not a matter I intend to address here, but perhaps it could
do with some review.)
Per report from Andres Freund and local testing.
Discussion: https://postgr.es/m/[email protected]
M src/port/snprintf.c
libpq: Reset singlerow flag correctly in pipeline mode
commit : b8af4166ff96af9c7bed1b511d0356284a8b7766
author : Alvaro Herrera <[email protected]>
date : Fri, 14 Oct 2022 19:06:26 +0200
committer: Alvaro Herrera <[email protected]>
date : Fri, 14 Oct 2022 19:06:26 +0200
When a query whose results were requested in single-row mode is the last
in the queue by the time those results are being read, the single-row
flag was not being reset, because we were returning early from
pqPipelineProcessQueue. Move that stanza up so that the flag is always
reset at the end of sending that query's results.
Add a test for the situation.
Backpatch to 14.
Author: Denis Laxalde <[email protected]>
Discussion: https://postgr.es/m/[email protected]
M src/interfaces/libpq/fe-exec.c
M src/test/modules/libpq_pipeline/libpq_pipeline.c
M src/test/modules/libpq_pipeline/traces/singlerow.trace
Fix typo in CREATE PUBLICATION reference page
commit : 3fe6f261f7a20cfc8e6809ae36bfe93d1f779751
author : Alvaro Herrera <[email protected]>
date : Thu, 13 Oct 2022 13:36:14 +0200
committer: Alvaro Herrera <[email protected]>
date : Thu, 13 Oct 2022 13:36:14 +0200
While at it, simplify wording a bit.
Author: Takamichi Osumi <[email protected]>
Reviewed-by: Peter Smith <[email protected]>
Discussion: https://postgr.es/m/TYCPR01MB8373F93F5D094A2BE648990DED259@TYCPR01MB8373.jpnprd01.prod.outlook.com
M doc/src/sgml/ref/create_publication.sgml
Doc: improve recommended systemd unit file.
commit : c6127303718cb25edab7de8bd6f76a0a1e31f3fb
author : Tom Lane <[email protected]>
date : Wed, 12 Oct 2022 10:51:11 -0400
committer: Tom Lane <[email protected]>
date : Wed, 12 Oct 2022 10:51:11 -0400
Add
After=network-online.target
Wants=network-online.target
to the suggested unit file for starting a Postgres server.
This delays startup until the network interfaces have been
configured; without that, any attempt to bind to a specific
IP address will fail.
If listen_addresses is set to "localhost" or "*", it might be
possible to get away with the less restrictive "network.target",
but I don't think we need to get into such detail here.
Per suggestion from Pablo Federico.
Discussion: https://postgr.es/m/[email protected]
M doc/src/sgml/runtime.sgml
Harden pmsignal.c against clobbered shared memory.
commit : b10546ecf8266d2b368b98ccd491eeae5160e316
author : Tom Lane <[email protected]>
date : Tue, 11 Oct 2022 18:54:31 -0400
committer: Tom Lane <[email protected]>
date : Tue, 11 Oct 2022 18:54:31 -0400
The postmaster is not supposed to do anything that depends
fundamentally on shared memory contents, because that creates
the risk that a backend crash that trashes shared memory will
take the postmaster down with it, preventing automatic recovery.
In commit 969d7cd43 I lost sight of this principle and coded
AssignPostmasterChildSlot() in such a way that it could fail
or even crash if the shared PMSignalState structure became
corrupted. Remarkably, we've not seen field reports of such
crashes; but I managed to induce one while testing the recent
changes around palloc chunk headers.
To fix, make a semi-duplicative state array inside the postmaster
so that we need consult only local state while choosing a "child
slot" for a new backend. Ensure that other postmaster-executed
routines in pmsignal.c don't have critical dependencies on the
shared state, either. Corruption of PMSignalState might now
lead ReleasePostmasterChildSlot() to conclude that backend X
failed, when actually backend Y was the one that trashed things.
But that doesn't matter, because we'll force a cluster-wide reset
regardless.
Back-patch to all supported branches, since this is an old bug.
Discussion: https://postgr.es/m/[email protected]
M src/backend/storage/ipc/pmsignal.c
Yet further fixes for multi-row VALUES lists for updatable views.
commit : 3162bd95cad3bf9ad89b9c7c8e50716cb513d46f
author : Tom Lane <[email protected]>
date : Tue, 11 Oct 2022 18:24:14 -0400
committer: Tom Lane <[email protected]>
date : Tue, 11 Oct 2022 18:24:14 -0400
DEFAULT markers appearing in an INSERT on an updatable view
could be mis-processed if they were in a multi-row VALUES clause.
This would lead to strange errors such as "cache lookup failed
for type NNNN", or in older branches even to crashes.
The cause is that commit 41531e42d tried to re-use rewriteValuesRTE()
to remove any SetToDefault nodes (that hadn't previously been replaced
by the view's own default values) appearing in "product" queries,
that is DO ALSO queries. That's fundamentally wrong because the
DO ALSO queries might not even be INSERTs; and even if they are,
their targetlists don't necessarily match the view's column list,
so that almost all the logic in rewriteValuesRTE() is inapplicable.
What we want is a narrow focus on replacing any such nodes with NULL
constants. (That is, in this context we are interpreting the defaults
as being strictly those of the view itself; and we already replaced
any that aren't NULL.) We could add still more !force_nulls tests
to further lobotomize rewriteValuesRTE(); but it seems cleaner to
split out this case to a new function, restoring rewriteValuesRTE()
to the charter it had before.
Per bug #17633 from jiye_sw. Patch by me, but thanks to
Richard Guo and Japin Li for initial investigation.
Back-patch to all supported branches, as the previous fix was.
Discussion: https://postgr.es/m/[email protected]
M src/backend/rewrite/rewriteHandler.c
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql
Ensure all perl test modules are installed
commit : 4f6d1cfd6b6f0707e4f4c3479261845263256f77
author : Alvaro Herrera <[email protected]>
date : Tue, 11 Oct 2022 09:56:13 +0200
committer: Alvaro Herrera <[email protected]>
date : Tue, 11 Oct 2022 09:56:13 +0200
PostgreSQL::Test::Cluster and ::Utils were not being installed. This is
very hard to notice, as it only seems to affect external modules that
want to run tests from 15 back in earlier versions. Oversight in
b235d41d9646.
This applies only to branches 14 and back, because 15 had already been
made correct in commit b3b4d8e68ae8.
Discussion: https://postgr.es/m/[email protected]
M src/test/perl/Makefile
Fix self-referencing foreign keys with partitioned tables
commit : 483d26930b4c804cecb9b074021244bd4b1c8499
author : Alvaro Herrera <[email protected]>
date : Fri, 7 Oct 2022 19:37:48 +0200
committer: Alvaro Herrera <[email protected]>
date : Fri, 7 Oct 2022 19:37:48 +0200
There are a number of bugs in this area. Two of them are fixed here,
namely:
1. get_relation_idx_constraint_oid does not restrict the type of
constraint that's returned, so with sufficient bad luck it can
return the OID of a foreign key constraint. This has the effect that
a primary key in a partition can end up as a child of a foreign key,
which makes no sense (it needs to be the child of the equivalent
primary key.)
Change the API contract so that only index-backed constraints are
returned, mimicking get_constraint_index().
2. Both CloneFkReferenced and CloneFkReferencing clone a
self-referencing foreign key, so the partition ends up with
a duplicate foreign key. Change the former function to ignore such
constraints.
Add some tests to verify that things are better now. (However, these
new tests show some additional misbehavior that will be fixed later --
namely that there's a constraint marked NOT VALID.)
Backpatch to 12, where these constraints are possible at all.
Author: Jehan-Guillaume de Rorthais <[email protected]>
Discussion: https://postgr.es/m/20220603154232.1715b14c@karst
M src/backend/catalog/pg_constraint.c
M src/backend/commands/tablecmds.c
M src/test/regress/expected/foreign_key.out
M src/test/regress/sql/foreign_key.sql
Avoid improbable PANIC during heap_update, redux.
commit : b93d7e6883d683ea35f4f5ea843222f47aacbaee
author : Tom Lane <[email protected]>
date : Fri, 30 Sep 2022 19:36:46 -0400
committer: Tom Lane <[email protected]>
date : Fri, 30 Sep 2022 19:36:46 -0400
Commit 34f581c39 intended to ensure that RelationGetBufferForTuple
would acquire a visibility-map page pin in case the otherBuffer's
all-visible bit had become set since we last had lock on that page.
But I missed a case: when we're extending the relation, VM concerns
were dealt with only in the relatively-less-likely case that we
fail to conditionally lock the otherBuffer. I think I'd believed
that we couldn't need to worry about it if the conditional lock
succeeds, which is true for the target buffer; but the otherBuffer
was unlocked for awhile so its bit might be set anyway. So we need
to do the GetVisibilityMapPins dance, and then also recheck the
page's free space, in both cases.
Per report from Jaime Casanova. Back-patch to v12 as the previous
patch was (although there's still no evidence that the bug is
reachable pre-v14).
Discussion: https://postgr.es/m/[email protected]
M src/backend/access/heap/hio.c
doc: Fix PQsslAttribute docs for compression
commit : 064e1c879dd28255202e94fdf766f4a98f916858
author : Daniel Gustafsson <[email protected]>
date : Fri, 30 Sep 2022 12:03:48 +0200
committer: Daniel Gustafsson <[email protected]>
date : Fri, 30 Sep 2022 12:03:48 +0200
The compression parameter to PQsslAttribute has never returned the
compression method used, it has always returned "on" or "off since
it was added in commit 91fa7b4719ac. Backpatch through v10.
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: v10
M doc/src/sgml/libpq.sgml
Update comment in ExecInsert() regarding batch insertion.
commit : fc9eb3f0c382dee11099ff400ff29f4b0132f16b
author : Etsuro Fujita <[email protected]>
date : Thu, 29 Sep 2022 16:55:03 +0900
committer: Etsuro Fujita <[email protected]>
date : Thu, 29 Sep 2022 16:55:03 +0900
Remove the stale text that is a leftover from an earlier version of the
patch to add support for batch insertion, and adjust the wording in the
remaining text.
Back-patch to v14 where batch insertion came in.
Review and wording adjustment by Tom Lane.
Discussion: https://postgr.es/m/CAPmGK14goatHPHQv2Aeu_UTKqZ%2BBO%2BP%2Bzd3HKv5D%2BdyyfWKDSw%40mail.gmail.com
M src/backend/executor/nodeModifyTable.c
doc: clarify internal behavior of RECURSIVE CTE queries
commit : 81c094bd93763f76190c2a78e13cae03e15b7432
author : Bruce Momjian <[email protected]>
date : Wed, 28 Sep 2022 13:14:38 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 28 Sep 2022 13:14:38 -0400
Reported-by: Tom Lane
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/queries.sgml
revert "warn of SECURITY DEFINER schemas for non-sql_body funcs"
commit : bbdc1d2334e63f761e4baf37ca3243f66f56f6be
author : Bruce Momjian <[email protected]>
date : Wed, 28 Sep 2022 13:05:20 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 28 Sep 2022 13:05:20 -0400
doc revert of commit 1703726488. Change was applied to irrelevant
branches, and was not detailed enough to be helpful in relevant
branches.
Reported-by: Peter Eisentraut, Noah Misch
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/ref/create_function.sgml
Change some errdetail() to errdetail_internal()
commit : f1e7f25b5aef2f3957aa4dbc5eda874871f693e0
author : Alvaro Herrera <[email protected]>
date : Wed, 28 Sep 2022 17:14:53 +0200
committer: Alvaro Herrera <[email protected]>
date : Wed, 28 Sep 2022 17:14:53 +0200
This prevents marking the argument string for translation for gettext,
and it also prevents the given string (which is already translated) from
being translated at runtime.
Also, mark the strings used as arguments to check_rolespec_name for
translation.
Backpatch all the way back as appropriate. None of this is caught by
any tests (necessarily so), so I verified it manually.
M src/backend/catalog/dependency.c
M src/backend/commands/user.c
M src/backend/utils/adt/acl.c
M src/backend/utils/adt/jsonfuncs.c
M src/common/jsonapi.c
Fix tupdesc lifespan bug with AfterTriggersTableData.storeslot.
commit : 9923764614a0a4e0e23f3455794d9c2ac0b1635d
author : Tom Lane <[email protected]>
date : Sun, 25 Sep 2022 17:10:58 -0400
committer: Tom Lane <[email protected]>
date : Sun, 25 Sep 2022 17:10:58 -0400
Commit 25936fd46 adjusted things so that the "storeslot" we use
for remapping trigger tuples would have adequate lifespan, but it
neglected to consider the lifespan of the tuple descriptor that
the slot depends on. It turns out that in at least some cases, the
tupdesc we are passing is a refcounted tupdesc, and the refcount for
the slot's reference can get assigned to a resource owner having
different lifespan than the slot does. That leads to an error like
"tupdesc reference 0x7fdef236a1b8 is not owned by resource owner
SubTransaction". Worse, because of a second oversight in the same
commit, we'd try to free the same tupdesc refcount again while
cleaning up after that error, leading to recursive errors and an
"ERRORDATA_STACK_SIZE exceeded" PANIC.
To fix the initial problem, let's just make a non-refcounted copy
of the tupdesc we're supposed to use. That seems likely to guard
against additional problems, since there's no strong reason for
this code to assume that what it's given is a refcounted tupdesc;
in which case there's an independent hazard of the tupdesc having
shorter lifespan than the slot does. (I didn't bother trying to
free said copy, since it should go away anyway when the (sub)
transaction context is cleaned up.)
The other issue can be fixed by making the code added to
AfterTriggerFreeQuery work like the rest of that function, ie be
sure that it doesn't try to free the same slot twice in the event
of recursive error cleanup.
While here, also clean up minor stylistic issues in the test case
added by 25936fd46: don't use "create or replace function", as any
name collision within the tests is likely to have ill effects
that that won't mask; and don't use function names as generic as
trigger_function1, especially if you're not going to drop them
at the end of the test stanza.
Per bug #17607 from Thomas Mc Kay. Back-patch to v12, as the
previous fix was.
Discussion: https://postgr.es/m/[email protected]
M src/backend/commands/trigger.c
M src/test/regress/expected/triggers.out
M src/test/regress/sql/triggers.sql
Add missing source files to pg_waldump/nls.mk
commit : f2094c78b8015b79c922c3424e0bb27be66d455b
author : Alvaro Herrera <[email protected]>
date : Sun, 25 Sep 2022 17:48:03 +0200
committer: Alvaro Herrera <[email protected]>
date : Sun, 25 Sep 2022 17:48:03 +0200
M src/bin/pg_waldump/nls.mk
Stop using PQsendQuery in libpq_pipeline
commit : 1c03166352c3fd94dd131938e42f2a182fcf4067
author : Alvaro Herrera <[email protected]>
date : Fri, 23 Sep 2022 18:11:48 +0200
committer: Alvaro Herrera <[email protected]>
date : Fri, 23 Sep 2022 18:11:48 +0200
The "emulation" I wrote for PQsendQuery in pipeline mode to use extended
query protocol, in commit acb7e4eb6b1c, is problematic. Due to numerous
bugs we'll soon remove it. As a first step and for all branches back to
14, stop using PQsendQuery in libpq_pipeline. Also remove a few test
lines that will no longer be relevant.
Backpatch to 14.
Discussion: https://postgr.es/m/CA+mi_8ZGSQNmW6-mk_iSR4JZB_LJ4ww3suOF+1vGNs3MrLsv4g@mail.gmail.com
M src/test/modules/libpq_pipeline/libpq_pipeline.c
M src/test/modules/libpq_pipeline/traces/pipeline_abort.trace
M src/test/modules/libpq_pipeline/traces/pipeline_idle.trace
Fix race condition where heap_delete() fails to pin VM page.
commit : 21934612d86a1e0c83c2774b776a022b9a5a90bd
author : Jeff Davis <[email protected]>
date : Thu, 22 Sep 2022 10:58:49 -0700
committer: Jeff Davis <[email protected]>
date : Thu, 22 Sep 2022 10:58:49 -0700
Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.
Discussion: https://postgr.es/m/CAEP4nAw9jYQDKd_5Y+-s2E4YiUJq1vqiikFjYGpLShtp-K3gag@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12
M src/backend/access/heap/heapam.c
Fix thinko in comment.
commit : e4514aafad0b134e67d7d0cf1612fb5c76fc8fec
author : Etsuro Fujita <[email protected]>
date : Thu, 22 Sep 2022 15:55:03 +0900
committer: Etsuro Fujita <[email protected]>
date : Thu, 22 Sep 2022 15:55:03 +0900
This comment has been wrong since its introduction in commit 0d5f05cde;
backpatch to v12 where that came in.
Discussion: https://postgr.es/m/CAPmGK14VGf-xQjGQN4o1QyAbXAaxugU5%3DqfcmTDh1iufUDnV_w%40mail.gmail.com
M src/backend/commands/copyfrom.c
docs: Fix snapshot name in SET TRANSACTION docs.
commit : be032619d4b16e74025d04e027b587d6e11e7cbd
author : Fujii Masao <[email protected]>
date : Thu, 22 Sep 2022 12:54:26 +0900
committer: Fujii Masao <[email protected]>
date : Thu, 22 Sep 2022 12:54:26 +0900
Commit 6c2003f8a1 changed the snapshot names mentioned in
SET TRANSACTION docs, however, there was one place that
the commit missed updating the name.
Back-patch to all supported versions.
Author: Japin Li
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/MEYP282MB1669BD4280044501165F8B07B64F9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
M doc/src/sgml/ref/set_transaction.sgml
Suppress more variable-set-but-not-used warnings from clang 15.
commit : 88c947cb52615e073503f92e12d942cca5609a3c
author : Tom Lane <[email protected]>
date : Wed, 21 Sep 2022 13:52:38 -0400
committer: Tom Lane <[email protected]>
date : Wed, 21 Sep 2022 13:52:38 -0400
Mop up assorted set-but-not-used warnings in the back branches.
This includes back-patching relevant fixes from commit 152c9f7b8
the rest of the way, but there are also several cases that did not
appear in HEAD. Some of those we'd fixed in a retail way but not
back-patched, and others I think just got rewritten out of existence
during nearby refactoring.
While here, also back-patch b1980f6d0 (PL/Tcl: Fix compiler warnings
with Tcl 8.6) into 9.2, so that that branch compiles warning-free
with modern Tcl.
Per project policy, this is a candidate for back-patching into
out-of-support branches: it suppresses annoying compiler warnings
but changes no behavior. Hence, back-patch all the way to 9.2.
Discussion: https://postgr.es/m/[email protected]
M src/backend/optimizer/util/var.c
Disable -Wdeprecated-non-prototype in the back branches.
commit : dcd7dbed50085eed92ff9733dca54e0fe5518c78
author : Tom Lane <[email protected]>
date : Tue, 20 Sep 2022 18:59:53 -0400
committer: Tom Lane <[email protected]>
date : Tue, 20 Sep 2022 18:59:53 -0400
There doesn't seem to be any good ABI-preserving way to silence
clang 15's -Wdeprecated-non-prototype warnings about our tree-walk
APIs. While we've fixed it properly in HEAD, the only way to not
see hundreds of these in the back branches is to disable the
warnings. We're not going to do anything about them, so we might
as well disable them.
I noticed that we also get some of these warnings about fmgr.c's
support for V0 function call convention, in branches before v10
where we removed that. That's another area we aren't going to
change, so turning off the warning seems fine for that too.
Per project policy, this is a candidate for back-patching into
out-of-support branches: it suppresses annoying compiler warnings
but changes no behavior. Hence, back-patch all the way to 9.2.
Discussion: https://postgr.es/m/CA+hUKGKpHPDTv67Y+s6yiC8KH5OXeDg6a-twWo_xznKTcG0kSA@mail.gmail.com
M configure
M configure.ac
Suppress variable-set-but-not-used warnings from clang 15.
commit : 2e124d857a64a91d2b70afdbed6156d753089771
author : Tom Lane <[email protected]>
date : Tue, 20 Sep 2022 12:04:37 -0400
committer: Tom Lane <[email protected]>
date : Tue, 20 Sep 2022 12:04:37 -0400
clang 15+ will issue a set-but-not-used warning when the only
use of a variable is in autoincrements (e.g., "foo++;").
That's perfectly sensible, but it detects a few more cases that
we'd not noticed before. Silence the warnings with our usual
methods, such as PG_USED_FOR_ASSERTS_ONLY, or in one case by
actually removing a useless variable.
One thing that we can't nicely get rid of is that with %pure-parser,
Bison emits "yynerrs" as a local variable that falls foul of this
warning. To silence those, I inserted "(void) yynerrs;" in the
top-level productions of affected grammars.
Per recently-established project policy, this is a candidate
for back-patching into out-of-support branches: it suppresses
annoying compiler warnings but changes no behavior. Hence,
back-patch to 9.5, which is as far as these patches go without
issues. (A preliminary check shows that the prior branches
need some other set-but-not-used cleanups too, so I'll leave
them for another day.)
Discussion: https://postgr.es/m/[email protected]
M src/backend/access/gist/gistxlog.c
M src/backend/access/transam/xlog.c
M src/backend/parser/gram.y
M src/backend/utils/adt/array_typanalyze.c
M src/backend/utils/adt/jsonpath_gram.y
M src/bin/pgbench/exprparse.y
doc: Fix parameter name for pg_create_logical_replication_slot()
commit : 382cc68007784623e365ec033468ec69535afbaf
author : Michael Paquier <[email protected]>
date : Tue, 20 Sep 2022 19:28:47 +0900
committer: Michael Paquier <[email protected]>
date : Tue, 20 Sep 2022 19:28:47 +0900
The parameter controlling if two-phase transactions can be decoded was
named "two_phase" in the documentation while its procedure defines
"twophase".
Author: Florin Irion
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 14
M doc/src/sgml/func.sgml
Fix incorrect variable types for origin IDs in decode.c
commit : e68fc64fd7f38927720d729c667906d209ebc09f
author : Michael Paquier <[email protected]>
date : Tue, 20 Sep 2022 18:13:46 +0900
committer: Michael Paquier <[email protected]>
date : Tue, 20 Sep 2022 18:13:46 +0900
These variables used XLogRecPtr instead of RepOriginId.
Author: Masahiko Sawada
Discussion: https://postgr.es/m/CAD21AoBm-vNyBSXGp4bmJGvhr=S-EGc5q1dtV70cFTcJvLhC=Q@mail.gmail.com
Backpatch-through: 14
M src/backend/replication/logical/decode.c
Future-proof the recursion inside ExecShutdownNode().
commit : 7394c763bc72db90cbca0fca8a17f96cc2bcc6f7
author : Tom Lane <[email protected]>
date : Mon, 19 Sep 2022 12:16:02 -0400
committer: Tom Lane <[email protected]>
date : Mon, 19 Sep 2022 12:16:02 -0400
The API contract for planstate_tree_walker() callbacks is that they
take a PlanState pointer and a context pointer. Somebody figured
they could save a couple lines of code by ignoring that, and passing
ExecShutdownNode itself as the walker even though it has but one
argument. Somewhat remarkably, we've gotten away with that so far.
However, it seems clear that the upcoming C2x standard means to
forbid such cases, and compilers that actively break such code
likely won't be far behind. So spend the extra few lines of code
to do it honestly with a separate walker function.
In HEAD, we might as well go further and remove ExecShutdownNode's
useless return value. I left that as-is in back branches though,
to forestall complaints about ABI breakage.
Back-patch, with the thought that this might become of practical
importance before our stable branches are all out of service.
It doesn't seem to be fixing any live bug on any currently known
platform, however.
Discussion: https://postgr.es/m/[email protected]
M src/backend/executor/execProcnode.c
Make check_usermap() parameter names consistent.
commit : 44933010ceb3ac06d4c01b559aafed4bef16c45d
author : Peter Geoghegan <[email protected]>
date : Sat, 17 Sep 2022 16:54:14 -0700
committer: Peter Geoghegan <[email protected]>
date : Sat, 17 Sep 2022 16:54:14 -0700
The function has a bool argument named "case_insensitive", but that was
spelled "case_sensitive" in the declaration. Make them consistent now
to avoid confusion in the future.
Author: Peter Geoghegan <[email protected]>
Reviewed-By: Michael Paquiër <[email protected]>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
Backpatch: 10-
M src/include/libpq/hba.h
Include c.h instead of postgres.h in src/port/*p{read,write}*.c
commit : b4b4b817da5a6293b17109f5a2d61f2e1ab8cf11
author : Andres Freund <[email protected]>
date : Sat, 17 Sep 2022 09:21:59 -0700
committer: Andres Freund <[email protected]>
date : Sat, 17 Sep 2022 09:21:59 -0700
Frontend code shouldn't include postgres.h. Some files in src/port/ need to
include postgres.h/postgres_fe.h, but these files don't.
Discussion: https://postgr.es/m/[email protected]
Backpatch: 12-, where 3fd2a7932ef introduced (some) of these files
M src/port/pread.c
M src/port/preadv.c
M src/port/pwrite.c
M src/port/pwritev.c
Improve plpgsql's ability to handle arguments declared as RECORD.
commit : 56d45fdab7b12cd0c767a8c1e7ab6c04390a32d8
author : Tom Lane <[email protected]>
date : Fri, 16 Sep 2022 13:23:01 -0400
committer: Tom Lane <[email protected]>
date : Fri, 16 Sep 2022 13:23:01 -0400
Treat arguments declared as RECORD as if that were a polymorphic type
(which it is, sort of), in that we substitute the actual argument type
while forming the function cache lookup key. This allows the specific
composite type to be known in some cases where it was not before,
at the cost of making a separate function cache entry for each named
composite type that's passed to the function during a session. The
particular symptom discussed in bug #17610 could be solved in other
more-efficient ways, but only at the cost of considerable development
work, and there are other cases where we'd still fail without this.
Per bug #17610 from Martin Jurča. Back-patch to v11 where we first
allowed plpgsql functions to be declared as taking type RECORD.
Discussion: https://postgr.es/m/[email protected]
M src/pl/plpgsql/src/expected/plpgsql_record.out
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/sql/plpgsql_record.sql
Detect format-string mistakes in the libpq_pipeline test module.
commit : bff7bc6cb785191041aa7530febdbb5cfe6eaf06
author : Tom Lane <[email protected]>
date : Thu, 15 Sep 2022 17:17:53 -0400
committer: Tom Lane <[email protected]>
date : Thu, 15 Sep 2022 17:17:53 -0400
I happened to notice that libpq_pipeline's private implementation
of pg_fatal lacked any pg_attribute_printf decoration. Indeed,
adding that turned up a mistake! We'd likely never have noticed
because the error exits in this code are unlikely to get hit,
but still, it's a bug.
We're so used to having the compiler check this stuff for us that
a printf-like function without pg_attribute_printf is a land mine.
I wonder if there is a way to detect such omissions.
Back-patch to v14 where this code came in.
M src/test/modules/libpq_pipeline/libpq_pipeline.c
postgres_fdw: Avoid 'variable not found in subplan target list' error.
commit : b53d104ae3b9cb0acfc6bb429261005bd07d3b3e
author : Etsuro Fujita <[email protected]>
date : Wed, 14 Sep 2022 18:45:03 +0900
committer: Etsuro Fujita <[email protected]>
date : Wed, 14 Sep 2022 18:45:03 +0900
The tlist of the EvalPlanQual outer plan for a ForeignScan node is
adjusted to produce a tuple whose descriptor matches the scan tuple slot
for the ForeignScan node. But in the case where the outer plan contains
an extra Sort node, if the new tlist contained columns required only for
evaluating PlaceHolderVars or columns required only for evaluating local
conditions, this would cause setrefs.c to fail with the error.
The cause of this is that when creating the outer plan by injecting the
Sort node into an alternative local join plan that could emit such extra
columns as well, we fail to arrange for the outer plan to propagate them
up through the Sort node, causing setrefs.c to fail to match up them in
the new tlist to what is available from the outer plan. Repair.
Per report from Alexander Pyhalov.
Richard Guo and Etsuro Fujita, reviewed by Alexander Pyhalov and Tom Lane.
Backpatch to all supported versions.
Discussion: http://postgr.es/m/cfb17bf6dfdf876467bd5ef533852d18%40postgrespro.ru
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/sql/postgres_fdw.sql
Fix incorrect value for "strategy" with deflateParams() in walmethods.c
commit : 4b529f4697f3cb59e1a225a741f14a1afb6bccd5
author : Michael Paquier <[email protected]>
date : Wed, 14 Sep 2022 14:52:28 +0900
committer: Michael Paquier <[email protected]>
date : Wed, 14 Sep 2022 14:52:28 +0900
The zlib documentation mentions the values supported for the compression
strategy, but this code has been using a hardcoded value of 0 rather
than Z_DEFAULT_STRATEGY. This commit adjusts the code to use
Z_DEFAULT_STRATEGY.
Backpatch down to where this code has been added to ease the backport of
any future patch touching this area.
Reported-by: Tom Lane
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M src/bin/pg_basebackup/walmethods.c
Expand palloc/pg_malloc API for more type safety
commit : b7f37af7c195519a041fcc6084cff95dc5e4a76f
author : Peter Eisentraut <[email protected]>
date : Wed, 14 Sep 2022 06:04:24 +0200
committer: Peter Eisentraut <[email protected]>
date : Wed, 14 Sep 2022 06:04:24 +0200
This adds additional variants of palloc, pg_malloc, etc. that
encapsulate common usage patterns and provide more type safety.
Specifically, this adds palloc_object(), palloc_array(), and
repalloc_array(), which take the type name of the object to be
allocated as its first argument and cast the return as a pointer to
that type. There are also palloc0_object() and palloc0_array()
variants for initializing with zero, and pg_malloc_*() variants of all
of the above.
Inspired by the talloc library.
This is backpatched from master so that future backpatchable code can
make use of these APIs. This patch by itself does not contain any
users of these APIs.
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
M src/include/common/fe_memutils.h
M src/include/utils/palloc.h
Don't reference out-of-bounds array elements in brin_minmax_multi.c
commit : c2aa5d01e3e33776f77e68a60ca5b60b58c5c674
author : David Rowley <[email protected]>
date : Tue, 13 Sep 2022 11:05:13 +1200
committer: David Rowley <[email protected]>
date : Tue, 13 Sep 2022 11:05:13 +1200
The primary fix here is to fix has_matching_range() so it does not
reference ranges->values[-1] when nranges == 0. Similar problems existed
in AssertCheckRanges() too. It does not look like any of these problems
could lead to a crash as the array in question is at the end of the Ranges
struct, and values[-1] is memory that belongs to other fields in the
struct. However, let's get rid of these rather unsafe coding practices.
In passing, I (David) adjusted some comments to try to make it more clear
what some of the fields are for in the Ranges struct. I had to study the
code to find out what nsorted was for as I couldn't tell from the
comments.
Author: Ranier Vilela
Discussion: https://postgr.es/m/CAEudQAqJQzPitufX-jR=YUbJafpCDAKUnwgdbX_MzSc93wuvdw@mail.gmail.com
Backpatch-through: 14, where multi-range brin was added.
M src/backend/access/brin/brin_minmax_multi.c
doc: Fix link to FreeBSD documentation project
commit : 293a6ac4b9898febe1cf9a4614facf6128be5d77
author : Daniel Gustafsson <[email protected]>
date : Mon, 12 Sep 2022 22:17:17 +0200
committer: Daniel Gustafsson <[email protected]>
date : Mon, 12 Sep 2022 22:17:17 +0200
The FreeBSD site was changed with a redirect, which in turn seems to
lead to a 404. Replace with the working link.
Author: James Coleman <[email protected]>
Discussion: https://postgr.es/m/CAAaqYe_JZRj+KPn=hACtwsg1iLRYs=jYvxG1NW4AnDeUL1GD-Q@mail.gmail.com
M doc/src/sgml/docguide.sgml
Fix NaN comparison in circle_same test
commit : 13b8a1c19626d425176b1e00a8104db1e339aaf3
author : Daniel Gustafsson <[email protected]>
date : Mon, 12 Sep 2022 12:59:06 +0200
committer: Daniel Gustafsson <[email protected]>
date : Mon, 12 Sep 2022 12:59:06 +0200
Commit c4c340088 changed geometric operators to use float4 and float8
functions, and handle NaN's in a better way. The circle sameness test
had a typo in the code which resulted in all comparisons with the left
circle having a NaN radius considered same.
postgres=# select '<(0,0),NaN>'::circle ~= '<(0,0),1>'::circle;
?column?
----------
t
(1 row)
This fixes the sameness test to consider the radius of both the left
and right circle.
Backpatch to v12 where this was introduced.
Author: Ranier Vilela <[email protected]>
Discussion: https://postgr.es/m/CAEudQAo8dK=yctg2ZzjJuzV4zgOPBxRU5+Kb+yatFiddtQk6Rw@mail.gmail.com
Backpatch-through: v12
M src/backend/utils/adt/geo_ops.c
M src/test/regress/expected/geometry.out
Fix possible omission of variable storage markers in ECPG.
commit : be0b0528cb64d49750fcb632faa2cfcd8d920be2
author : Tom Lane <[email protected]>
date : Fri, 9 Sep 2022 15:34:04 -0400
committer: Tom Lane <[email protected]>
date : Fri, 9 Sep 2022 15:34:04 -0400
The ECPG preprocessor converted code such as
static varchar str1[10], str2[20], str3[30];
into
static struct varchar_1 { int len; char arr[ 10 ]; } str1 ;
struct varchar_2 { int len; char arr[ 20 ]; } str2 ;
struct varchar_3 { int len; char arr[ 30 ]; } str3 ;
thus losing the storage attribute for the later variables.
Repeat the declaration for each such variable.
(Note that this occurred only for variables declared "varchar"
or "bytea", which may help explain how it escaped detection
for so long.)
Andrey Sokolov
Discussion: https://postgr.es/m/[email protected]
M src/interfaces/ecpg/preproc/ecpg.trailer
M src/interfaces/ecpg/preproc/type.h
M src/interfaces/ecpg/test/expected/preproc-variable.c
M src/interfaces/ecpg/test/expected/preproc-variable.stderr
M src/interfaces/ecpg/test/expected/preproc-variable.stdout
M src/interfaces/ecpg/test/preproc/variable.pgc
Reject bogus output from uuid_create(3).
commit : e55ccb3b179cbfc5b436339cf1a71d21a73c79dc
author : Tom Lane <[email protected]>
date : Fri, 9 Sep 2022 12:41:36 -0400
committer: Tom Lane <[email protected]>
date : Fri, 9 Sep 2022 12:41:36 -0400
When using the BSD UUID functions, contrib/uuid-ossp expects
uuid_create() to produce a version-1 UUID. FreeBSD still does so,
but in recent NetBSD releases that function produces a version-4
(random) UUID instead. That's not acceptable for our purposes:
if the user wanted v4 she would have asked for v4, not v1.
Hence, check the version digit and complain if it's not '1'.
Also drop the documentation's claim that the NetBSD implementation
is usable. It might be, depending on which OS version you're using,
but we're not going to get into that kind of detail.
(Maybe someday we should ditch all these external libraries
and just write our own UUID code, but today is not that day.)
Nazir Bilal Yavuz, with cosmetic adjustments and docs by me.
Backpatch to all supported versions.
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
M contrib/uuid-ossp/uuid-ossp.c
M doc/src/sgml/installation.sgml
M doc/src/sgml/uuid-ossp.sgml
Choose FK name correctly during partition attachment
commit : 640c20d6266ddc89e7969c697681d3f869f92dfb
author : Alvaro Herrera <[email protected]>
date : Thu, 8 Sep 2022 13:17:02 +0200
committer: Alvaro Herrera <[email protected]>
date : Thu, 8 Sep 2022 13:17:02 +0200
During ALTER TABLE ATTACH PARTITION, if the name of a parent's foreign
key constraint is already used on the partition, the code tries to
choose another one before the FK attributes list has been populated,
so the resulting constraint name was "<relname>__fkey" instead of
"<relname>_<attrs>_fkey". Repair, and add a test case.
Backpatch to 12. In 11, the code to attach a partition was not smart
enough to cope with conflicting constraint names, so the problem doesn't
exist there.
Author: Jehan-Guillaume de Rorthais <[email protected]>
Discussion: https://postgr.es/m/20220901184156.738ebee5@karst
M src/backend/commands/tablecmds.c
M src/test/regress/input/constraints.source
M src/test/regress/output/constraints.source
Doc: clarify partitioned table limitations
commit : a254545a54a2e14ec6f41b8190d6c6713a85a18a
author : David Rowley <[email protected]>
date : Mon, 5 Sep 2022 18:44:11 +1200
committer: David Rowley <[email protected]>
date : Mon, 5 Sep 2022 18:44:11 +1200
Improve documentation regarding the limitations of unique and primary key
constraints on partitioned tables. The existing documentation didn't make
it clear that the constraint columns had to be present in the partition
key as bare columns. The reader could be led to believe that it was ok to
include the constraint columns as part of a function call's parameters or
as part of an expression. Additionally, the documentation didn't mention
anything about the fact that we disallow unique and primary key
constraints if the partition keys contain *any* function calls or
expressions, regardless of if the constraint columns appear as columns
elsewhere in the partition key.
The confusion here was highlighted by a report on the general mailing list
by James Vanns.
Discussion: https://postgr.es/m/CAH7vdhNF0EdYZz3GLpgE3RSJLwWLhEk7A_fiKS9dPBT3Dz_3eA@mail.gmail.com
Discussion: https://postgr.es/m/CAApHDvoU-u9iTqKjteYRFfi+UNEk7dbSAcyxEQD==vZt9B1KnA@mail.gmail.com
Reviewed-by: Erik Rijkers
Backpatch-through: 11
M doc/src/sgml/ddl.sgml
doc: Fix two queries related to jsonb functions
commit : bc73bd26f17f236368a0a3434e0c632d332803ca
author : Michael Paquier <[email protected]>
date : Sat, 3 Sep 2022 20:57:30 +0900
committer: Michael Paquier <[email protected]>
date : Sat, 3 Sep 2022 20:57:30 +0900
These have been updated by the revert done in 2f2b18b, but the
pre-revert state was correct. Note that the result was incorrectly
formatted in the first case.
Author: Erik Rijkers
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13
M doc/src/sgml/func.sgml
doc: simplify docs about analyze and inheritance/partitions
commit : 413074273918e223a496e0f5348c3b74c620b211
author : Bruce Momjian <[email protected]>
date : Fri, 2 Sep 2022 23:32:19 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 2 Sep 2022 23:32:19 -0400
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/ref/analyze.sgml
doc: clarify recursion internal behavior
commit : 3eef32c58b438e08071acb22580162976bce680b
author : Bruce Momjian <[email protected]>
date : Fri, 2 Sep 2022 21:57:41 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 2 Sep 2022 21:57:41 -0400
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/queries.sgml
Doc: Update struct Trigger definition.
commit : 5527b79cc04a6aa3aab885d3bcd7162b4c620b1c
author : Etsuro Fujita <[email protected]>
date : Fri, 2 Sep 2022 16:45:03 +0900
committer: Etsuro Fujita <[email protected]>
date : Fri, 2 Sep 2022 16:45:03 +0900
Commit 487e9861d added a new field to struct Trigger, but failed to
update the documentation to match; backpatch to v13 where that came in.
Reviewed by Richard Guo.
Discussion: https://postgr.es/m/CAPmGK17NY92CyxJ%2BBG7A3JZurmng4jfRfzPiBTtNupGMF0xW1g%40mail.gmail.com
M doc/src/sgml/trigger.sgml
Fix some possibly latent bugs in slab.c
commit : 6ec89610925448b1e7e9377afa73e158b291693c
author : David Rowley <[email protected]>
date : Thu, 1 Sep 2022 19:22:35 +1200
committer: David Rowley <[email protected]>
date : Thu, 1 Sep 2022 19:22:35 +1200
Primarily, this fixes an incorrect calculation in SlabCheck which was
looking in the wrong byte for the sentinel check. The reason that we've
never noticed this before in the form of a failing sentinel check is
because the pre-check to this always fails because all current core users
of slab contexts have a chunk size which is already MAXALIGNed, therefore
there's never any space for the sentinel byte. It is possible that an
extension needs to use a slab context and if they do with a chunk size
that's not MAXALIGNed, then they'll likely get errors about overwritten
sentinel bytes.
Additionally, this patch changes various calculations which are being done
based on the sizeof(SlabBlock). Currently, sizeof(SlabBlock) is a
multiple of 8, therefore sizeof(SlabBlock) is the same as
MAXALIGN(sizeof(SlabBlock)), however, if we were to ever have to add any
fields to that struct as part of a bug fix, then SlabAlloc could end up
returning a non-MAXALIGNed pointer. To be safe, let's ensure we always
MAXALIGN sizeof(SlabBlock) before using it in any calculations.
This patch has already been applied to master in d5ee4db0e.
Diagnosed-by: Tomas Vondra, Tom Lane
Author: Tomas Vondra, David Rowley
Discussion: https://postgr.es/m/CAA4eK1%2B1JyW5TiL%3DyV-3Uq1CrfnTyn0Xrk5uArt31Z%3D8rgPhXQ%40mail.gmail.com
Backpatch-through: 10
M src/backend/utils/mmgr/slab.c
doc: in create statistics docs, mention analyze for parent info
commit : 8f32ac5a16197f1ee89c6b20be9ea209dc5da5ee
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 23:11:46 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 23:11:46 -0400
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/ref/create_statistics.sgml
doc: mention "bloom" as a possible index access method
commit : 6fac58814c5d9fb75ac67d2bcf7732748d5634f2
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 22:35:09 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 22:35:09 -0400
Also remove USING erroneously added recently.
Reported-by: Jeff Janes
Discussion: https://postgr.es/m/CAMkU=1zhCpC7hottyMWM5Pimr9vRLprSwzLg+7PgajWhKZqRzw@mail.gmail.com
Backpatch-through: 10
M doc/src/sgml/indices.sgml
M doc/src/sgml/ref/create_index.sgml
doc: use FILTER in aggregate example
commit : d11a53a8e0a77c95c47e6f2514c1ba70c18d60e0
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 22:19:06 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 22:19:06 -0400
Reported-by: [email protected]
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/query.sgml
doc: clarify that pgcrypto's gen_random_uuid calls core func.
commit : 9d8f19201a6e6b53590080b892b41f6cca6eec26
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 22:04:36 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 22:04:36 -0400
Previously it was just marked as a duplicate of the core function.
Reported-by: Andreas Dijkman
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 13
M doc/src/sgml/pgcrypto.sgml
doc: split out the NATURAL/CROSS JOIN in SELECT syntax
commit : d514d77ac3e36935803f2101124a1af2b57d4bf1
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 21:46:14 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 21:46:14 -0400
This allows the syntax to be more accurate about what clauses are
supported. Also switch an example query to use the ANSI join syntax.
Reported-by: Joel Jacobson
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 11
M doc/src/sgml/ref/select.sgml
doc: warn of SECURITY DEFINER schemas for non-sql_body functions
commit : b566f320c81878af248da0dda8f30b8327719692
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 21:10:37 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 21:10:37 -0400
Non-sql_body functions are evaluated at runtime.
Reported-by: Erki Eessaar
Discussion: https://postgr.es/m/AM9PR01MB8268BF5E74E119828251FD34FE409@AM9PR01MB8268.eurprd01.prod.exchangelabs.com
Backpatch-through: 10
M doc/src/sgml/ref/create_function.sgml
doc: mention that SET TIME ZONE often needs to be quoted
commit : 4eab0181a0e1a72d4a3dd524210c3384bd6396e9
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 20:27:27 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 20:27:27 -0400
Also mention that time zone abbreviations are not supported.
Reported-by: [email protected]
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/ref/set.sgml
doc: document the maximum char/varchar length value
commit : 92557ac314e52c248d0a864c5e4b6088cddd8687
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 19:43:06 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 19:43:06 -0400
Reported-by: Japin Li
Discussion: https://postgr.es/m/MEYP282MB1669B13E98AE531617CB1386B6979@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Backpatch-through: 10
M doc/src/sgml/datatype.sgml
doc: show direction is optional in FETCH/MOVE's FROM/IN syntax
commit : 086ec88cda3f408b3720e352a69d41d54f97adf6
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 19:28:42 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 19:28:42 -0400
It used to show direction was required for FROM/IN.
Reported-by: Rob <[email protected]>
Discussion: https://postgr.es/m/20211015165248.isqjceyilelhnu3k@localhost
Author: Rob <[email protected]>
Backpatch-through: 10
M doc/src/sgml/ref/fetch.sgml
M doc/src/sgml/ref/move.sgml
doc: simplify WITH clause syntax in CREATE DATABASE
commit : c1f54eac3ab67e70f507cd82d4057e4abb070111
author : Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 17:08:44 -0400
committer: Bruce Momjian <[email protected]>
date : Wed, 31 Aug 2022 17:08:44 -0400
Reported-by: Rob <[email protected]>
Discussion: https://postgr.es/m/20211016171149.yaouvlw5kvux6dvk@localhost
Author: Rob <[email protected]>
Backpatch-through: 10
M doc/src/sgml/ref/create_database.sgml
Prevent long-term memory leakage in autovacuum launcher.
commit : feec1b2d5af4bbac9106065f5b9f55413084a543
author : Tom Lane <[email protected]>
date : Wed, 31 Aug 2022 16:23:20 -0400
committer: Tom Lane <[email protected]>
date : Wed, 31 Aug 2022 16:23:20 -0400
get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it. The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.
Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic. I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes. So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.
Reid Thompson
Discussion: https://postgr.es/m/[email protected]
M src/backend/postmaster/autovacuum.c
In the Snowball dictionary, don't try to stem excessively-long words.
commit : e969f1ae2b01d7b69371332b839fa16e3b54e56d
author : Tom Lane <[email protected]>
date : Wed, 31 Aug 2022 10:42:05 -0400
committer: Tom Lane <[email protected]>
date : Wed, 31 Aug 2022 10:42:05 -0400
If the input word exceeds 1000 bytes, don't pass it to the stemmer;
just return it as-is after case folding. Such an input is surely
not a word in any human language, so whatever the stemmer might
do to it would be pretty dubious in the first place. Adding this
restriction protects us against a known recursion-to-stack-overflow
problem in the Turkish stemmer, and it seems like good insurance
against any other safety or performance issues that may exist in
the Snowball stemmers. (I note, for example, that they contain no
CHECK_FOR_INTERRUPTS calls, so we really don't want them running
for a long time.) The threshold of 1000 bytes is arbitrary.
An alternative definition could have been to treat such words as
stopwords, but that seems like a bigger break from the old behavior.
Per report from Egor Chindyaskin and Alexander Lakhin.
Thanks to Olly Betts for the recommendation to fix it this way.
Discussion: https://postgr.es/m/[email protected]
M src/backend/snowball/dict_snowball.c
On NetBSD, force dynamic symbol resolution at postmaster start.
commit : 464db46760d2a89e1933038330f1d84210115886
author : Tom Lane <[email protected]>
date : Tue, 30 Aug 2022 17:28:32 -0400
committer: Tom Lane <[email protected]>
date : Tue, 30 Aug 2022 17:28:32 -0400
The default of lazy symbol resolution means that when the postmaster
first reaches the select() call in ServerLoop, it'll need to resolve
the link to that libc entry point. NetBSD's dynamic loader takes
an internal lock while doing that, and if a signal interrupts the
operation then there is a risk of self-deadlock should the signal
handler do anything that requires that lock, as several of the
postmaster signal handlers do. The window for this is pretty narrow,
and timing considerations make it unlikely that a signal would arrive
right then anyway. But it's semi-repeatable on slow single-CPU
machines, and in principle the race could happen with any hardware.
The least messy solution to this is to force binding of dynamic
symbols at postmaster start, using the "-z now" linker option.
While we're at it, also use "-z relro" so as to provide a small
security gain.
It's not entirely clear whether any other platforms share this
issue, but for now we'll assume it's NetBSD-specific. (We might
later try to use "-z now" on more platforms for performance
reasons, but that would not likely be something to back-patch.)
Report and patch by me; the idea to fix it this way is from
Andres Freund.
Discussion: https://postgr.es/m/[email protected]
M src/template/netbsd
Prevent WAL corruption after a standby promotion.
commit : 0e54a5e27494dd4184632aadb26a070e85fb8587
author : Robert Haas <[email protected]>
date : Mon, 29 Aug 2022 10:47:12 -0400
committer: Robert Haas <[email protected]>
date : Mon, 29 Aug 2022 10:47:12 -0400
When a PostgreSQL instance performing archive recovery but not using
standby mode is promoted, and the last WAL segment that it attempted
to read ended in a partial record, the previous code would create
invalid WAL on the new timeline. The WAL from the previously timeline
would be copied to the new timeline up until the end of the last valid
record, but instead of beginning to write WAL at immediately
afterwards, the promoted server would write an overwrite contrecord at
the beginning of the next segment. The end of the previous segment
would be left as all-zeroes, resulting in failures if anything tried
to read WAL from that file.
The root of the issue is that ReadRecord() decides whether to set
abortedRecPtr and missingContrecPtr based on the value of StandbyMode,
but ReadRecord() switches to a new timeline based on the value of
ArchiveRecoveryRequested. We shouldn't try to write an overwrite
contrecord if we're switching to a new timeline, so change the test in
ReadRecod() to check ArchiveRecoveryRequested instead.
Code fix by Dilip Kumar. Comments by me incorporating suggested
language from Álvaro Herrera. Further review from Kyotaro Horiguchi
and Sami Imseih.
Discussion: http://postgr.es/m/CAFiTN-t7umki=PK8dT1tcPV=mOUe2vNhHML6b3T7W7qqvvajjg@mail.gmail.com
Discussion: http://postgr.es/m/FB0DEA0B-E14E-43A0-811F-C1AE93D00FF3%40amazon.com
M src/backend/access/transam/xlog.c
Doc: fix example of recursive query.
commit : 7f5dd42a40fba039543c66333714d51a469d8945
author : Tom Lane <[email protected]>
date : Sun, 28 Aug 2022 10:44:52 -0400
committer: Tom Lane <[email protected]>
date : Sun, 28 Aug 2022 10:44:52 -0400
Compute total number of sub-parts correctly, per [email protected]
Simon Riggs
Discussion: https://postgr.es/m/[email protected]
M doc/src/sgml/queries.sgml
Use correct connection for cancellation in frontend's parallel slots
commit : aeec3534ccf3fa4a207694955b4078a9a9dafc8f
author : Michael Paquier <[email protected]>
date : Sat, 27 Aug 2022 15:22:11 +0900
committer: Michael Paquier <[email protected]>
date : Sat, 27 Aug 2022 15:22:11 +0900
While waiting for slots to become available in wait_on_slots() in
parallel_slot.c, the cancellation always relied on the first connection
in the set to do the job. This could cause problems when this slot's
socket is gone as PQgetCancel() would return NULL in this case. Rather
than always using the first connection, this changes the logic to use
the first valid connection for the cancellation.
Author: Ranier Vilela
Reviewed-by: Justin Pryzby
Discussion: https://postgr.es/m/CAEudQAokk1h_pUwGXsYS4oVOuf35s1O2o3TXGHpV8=AWikvgHA@mail.gmail.com
Backpatch-through: 14
M src/fe_utils/parallel_slot.c
Fix typo in comment.
commit : 28d351c9ff2afe5cc18ef64779c02c49c76896fb
author : Etsuro Fujita <[email protected]>
date : Fri, 26 Aug 2022 16:55:02 +0900
committer: Etsuro Fujita <[email protected]>
date : Fri, 26 Aug 2022 16:55:02 +0900
M src/backend/commands/copyfromparse.c
Defend against stack overrun in a few more places.
commit : 444ec169a7def141f9520c1111a31c8a5dda22ce
author : Tom Lane <[email protected]>
date : Wed, 24 Aug 2022 13:01:40 -0400
committer: Tom Lane <[email protected]>
date : Wed, 24 Aug 2022 13:01:40 -0400
SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c,
and regex_selectivity_sub() in selectivity estimation could recurse
until stack overflow; fix by adding check_stack_depth() calls.
So could next() in the regex compiler, but that case is better fixed by
converting its tail recursion to a loop. (We probably get better code
that way too, since next() can now be inlined into its sole caller.)
There remains a reachable stack overrun in the Turkish stemmer, but
we'll need some advice from the Snowball people about how to fix that.
Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes
are old, so back-patch to all supported branches.
Richard Guo and Tom Lane
Discussion: https://postgr.es/m/[email protected]
M src/backend/regex/regc_lex.c
M src/backend/tsearch/spell.c
M src/backend/utils/adt/geo_ops.c
M src/backend/utils/adt/like_support.c
Doc: document possible need to raise kernel's somaxconn limit.
commit : 04f1013be084a12a251c7087b06664d0918755e6
author : Tom Lane <[email protected]>
date : Tue, 23 Aug 2022 09:55:37 -0400
committer: Tom Lane <[email protected]>
date : Tue, 23 Aug 2022 09:55:37 -0400
On fast machines, it's possible for applications such as pgbench
to issue connection requests so quickly that the postmaster's
listen queue overflows in the kernel, resulting in unexpected
failures (with not-very-helpful error messages). Most modern OSes
allow the queue size to be increased, so document how to do that.
Per report from Kevin McKibbin.
Discussion: https://postgr.es/m/CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com
M doc/src/sgml/runtime.sgml
Doc: prefer sysctl to /proc/sys in docs and comments.
commit : eb0097c6f3eeb559e33369066be7279f540d05db
author : Tom Lane <[email protected]>
date : Tue, 23 Aug 2022 09:41:37 -0400
committer: Tom Lane <[email protected]>
date : Tue, 23 Aug 2022 09:41:37 -0400
sysctl is more portable than Linux's /proc/sys file tree, and
often easier to use too. That's why most of our docs refer to
sysctl when talking about how to adjust kernel parameters.
Bring the few stragglers into line.
Discussion: https://postgr.es/m/[email protected]
M doc/src/sgml/runtime.sgml
M src/backend/postmaster/postmaster.c
Add CHECK_FOR_INTERRUPTS while decoding changes.
commit : 6d05d575bec5ef9a05f8d62f1c872b71dde32a01
author : Amit Kapila <[email protected]>
date : Tue, 23 Aug 2022 09:24:51 +0530
committer: Amit Kapila <[email protected]>
date : Tue, 23 Aug 2022 09:24:51 +0530
While decoding changes in a loop, if we skip all the changes there is no
CFI making the loop uninterruptible.
Reported-by: Whale Song and Andrey Borodin
Bug: 17580
Author: Masahiko Sawada
Reviwed-by: Amit Kapila
Backpatch-through: 10
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
M src/backend/replication/logical/reorderbuffer.c
Fix subtly-incorrect matching of parent and child partitioned indexes.
commit : 3bfea5cbba983d35506d29563952fbadb782ef52
author : Tom Lane <[email protected]>
date : Thu, 18 Aug 2022 12:11:47 -0400
committer: Tom Lane <[email protected]>
date : Thu, 18 Aug 2022 12:11:47 -0400
When creating a partitioned index, DefineIndex tries to identify
any existing indexes on the partitions that match the partitioned
index, so that it can absorb those as child indexes instead of
building new ones. Part of the matching is to compare IndexInfo
structs --- but that wasn't done quite right. We're comparing
the IndexInfo built within DefineIndex itself to one made from
existing catalog contents by BuildIndexInfo. Notably, while
BuildIndexInfo will run index expressions and predicates through
expression preprocessing, that has not happened to DefineIndex's
struct. The result is failure to match and subsequent creation
of duplicate indexes.
The easiest and most bulletproof fix is to build a new IndexInfo
using BuildIndexInfo, thereby guaranteeing that the processing done
is identical.
While here, let's also extract the opfamily and collation data
from the new partitioned index, removing ad-hoc logic that
duplicated knowledge about how those are constructed.
Per report from Christophe Pettus. Back-patch to v11 where
we invented partitioned indexes.
Richard Guo and Tom Lane
Discussion: https://postgr.es/m/[email protected]
M src/backend/commands/indexcmds.c
M src/test/regress/expected/indexing.out
M src/test/regress/sql/indexing.sql
Fix assert in logicalmsg_desc
commit : 239c3ee41be3b7c621c446344d09e3affeb8cd59
author : Tomas Vondra <[email protected]>
date : Tue, 16 Aug 2022 23:52:10 +0200
committer: Tomas Vondra <[email protected]>
date : Tue, 16 Aug 2022 23:52:10 +0200
The assert, introduced by 9f1cf97bb5, is intended to check if the prefix
is terminated by a \0 byte, but it has two flaws. Firstly, prefix_size
includes the \0 byte, so prefix[prefix_size] points to the byte after
the null byte. Secondly, the check ensures the byte is not equal \0,
while it should be checking the opposite.
Backpatch-through: 14
Discussion: https://postgr.es/m/[email protected]
M src/backend/access/rmgrdesc/logicalmsgdesc.c
doc: Remove reference to tty libpq connstring param
commit : 1d968b87047708eae1d0eef27860668ec318a3ee
author : Daniel Gustafsson <[email protected]>
date : Tue, 16 Aug 2022 22:54:43 +0200
committer: Daniel Gustafsson <[email protected]>
date : Tue, 16 Aug 2022 22:54:43 +0200
The tty connection string parameter was removed in commit 14d9b3760
but the reference to it in the docs was mistakenly kept. Fix by
removing it from the libpq documentation. Backpatch through v14
where the parameter was removed.
Author: Noriyoshi Shinoda <[email protected]>
Discussion: https://postgr.es/m/DM4PR84MB173433216FCC2A3961879000EE6B9@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM
Backpatch-through: 14
M doc/src/sgml/libpq.sgml
Fix replica identity check for a partitioned table.
commit : 02f8d68af256c34cfac774ae46b2d4a465d35276
author : Amit Kapila <[email protected]>
date : Tue, 16 Aug 2022 14:51:42 +0530
committer: Amit Kapila <[email protected]>
date : Tue, 16 Aug 2022 14:51:42 +0530
The current publisher code checks if UPDATE or DELETE can be executed with
the replica identity of the table even if it's a partitioned table. We can
skip checking the replica identity for partitioned tables because the
operations are actually performed on the leaf partitions (not the
partitioned table).
Reported-by: Brad Nicholson
Author: Hou Zhijie
Reviewed-by: Peter Smith, Amit Kapila
Backpatch-through: 13
Discussion: https://postgr.es/m/CAMMnM%3D8i5DohH%3DYKzV0_wYuYSYvuOJoL9F5nzXTc%2ByzsG1f6rg%40mail.gmail.com
M src/backend/executor/execReplication.c
M src/test/regress/expected/publication.out
M src/test/regress/sql/publication.sql
doc: fix wrong tag used in create sequence manual.
commit : a1a5e6d95cc9fabbd4e0209161662aa45220c4b1
author : Tatsuo Ishii <[email protected]>
date : Tue, 16 Aug 2022 09:27:34 +0900
committer: Tatsuo Ishii <[email protected]>
date : Tue, 16 Aug 2022 09:27:34 +0900
In ref/create_sequence.sgml <literal> tag was used for nextval function name.
This should have been <function> tag.
Author: Noboru Saito
Discussion: https://postgr.es/m/CAAM3qnJTDFFfRf5JHJ4AYrNcqXgMmj0pbH0%2Bvm%3DYva%2BpJyGymA%40mail.gmail.com
Backpatch-through: 10
M doc/src/sgml/ref/create_sequence.sgml
Add missing bad-PGconn guards in libpq entry points.
commit : d63a69157d189bf3d56eb5ad37fa67d0134bfb31
author : Tom Lane <[email protected]>
date : Mon, 15 Aug 2022 15:40:07 -0400
committer: Tom Lane <[email protected]>
date : Mon, 15 Aug 2022 15:40:07 -0400
There's a convention that externally-visible libpq functions should
check for a NULL PGconn pointer, and fail gracefully instead of
crashing. PQflush() and PQisnonblocking() didn't get that memo
though. Also add a similar check to PQdefaultSSLKeyPassHook_OpenSSL;
while it's not clear that ordinary usage could reach that with a
null conn pointer, it's cheap enough to check, so let's be consistent.
Daniele Varrazzo and Tom Lane
Discussion: https://postgr.es/m/CA+mi_8Zm_mVVyW1iNFgyMd9Oh0Nv8-F+7Y3-BqwMgTMHuo_h2Q@mail.gmail.com
M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-secure-openssl.c
Fix outdated --help message for postgres -f
commit : 63b64d8270691894a9a8f2d4e929e7780020edb8
author : Michael Paquier <[email protected]>
date : Mon, 15 Aug 2022 13:37:38 +0900
committer: Michael Paquier <[email protected]>
date : Mon, 15 Aug 2022 13:37:38 +0900
This option switch supports a total of 8 values, as told by
set_plan_disabling_options() and the documentation, but this was not
reflected in the output generated by --help.
Author: Junwang Zhao
Discussion: https://postgr.es/m/CAEG8a3+pT3cWzyjzKs184L1XMNm8NDnoJLiSjAYSO7XqpRh_vA@mail.gmail.com
Backpatch-through: 10
M src/backend/main/main.c
Preserve memory context of VarStringSortSupport buffers.
commit : 06602372b36df2b36e4db5ac30504dad878ea254
author : Tom Lane <[email protected]>
date : Sun, 14 Aug 2022 12:05:27 -0400
committer: Tom Lane <[email protected]>
date : Sun, 14 Aug 2022 12:05:27 -0400
When enlarging the work buffers of a VarStringSortSupport object,
varstrfastcmp_locale was careful to keep them in the ssup_cxt
memory context; but varstr_abbrev_convert just used palloc().
The latter creates a hazard that the buffers could be freed out
from under the VarStringSortSupport object, resulting in stomping
on whatever gets allocated in that memory later.
In practice, because we only use this code for ICU collations
(cf. 3df9c374e), the problem is confined to use of ICU collations.
I believe it may have been unreachable before the introduction
of incremental sort, too, as traditional sorting usually just
uses one context for the duration of the sort.
We could fix this by making the broken stanzas in varstr_abbrev_convert
match the non-broken ones in varstrfastcmp_locale. However, it seems
like a better idea to dodge the issue altogether by replacing the
pfree-and-allocate-anew coding with repalloc, which automatically
preserves the chunk's memory context. This fix does add a few cycles
because repalloc will copy the chunk's content, which the existing
coding assumes is useless. However, we don't expect that these buffer
enlargement operations are performance-critical. Besides that, it's
far from obvious that copying the buffer contents isn't required, since
these stanzas make no effort to mark the buffers invalid by resetting
last_returned, cache_blob, etc. That seems to be safe upon examination,
but it's fragile and could easily get broken in future, which wouldn't
get revealed in testing with short-to-moderate-size strings.
Per bug #17584 from James Inform. Whether or not the issue is
reachable in the older branches, this code has been broken on its
own terms from its introduction, so patch all the way back.
Discussion: https://postgr.es/m/[email protected]
M src/backend/utils/adt/varlena.c
Avoid misbehavior when hash_table_bytes < bucket_size.
commit : 1dfc9193af7ff3cde963aa153e21fadbfebe030a
author : Tom Lane <[email protected]>
date : Sat, 13 Aug 2022 16:59:58 -0400
committer: Tom Lane <[email protected]>
date : Sat, 13 Aug 2022 16:59:58 -0400
It's possible to reach this case when work_mem is very small and tupsize
is (relatively) very large. In that case ExecChooseHashTableSize would
get an assertion failure, or with asserts off it'd compute nbuckets = 0,
which'd likely cause misbehavior later (I've not checked). To fix,
clamp the number of buckets to be at least 1.
This is due to faulty conversion of old my_log2() coding in 28d936031.
Back-patch to v13, as that was.
Zhang Mingli
Discussion: https://postgr.es/m/beb64ca0-91e2-44ac-bf4a-7ea36275ec02@Spark
M src/backend/executor/nodeHash.c
Catch stack overflow when recursing in transformFromClauseItem().
commit : 496ab1d6c8d853899595e986f04cd70c4b13dac4
author : Tom Lane <[email protected]>
date : Sat, 13 Aug 2022 15:21:28 -0400
committer: Tom Lane <[email protected]>
date : Sat, 13 Aug 2022 15:21:28 -0400
Most parts of the parser can expect that the stack overflow check
in transformExprRecurse() will trigger before things get desperate.
However, transformFromClauseItem() can recurse directly to self
without having analyzed any expressions, so it's possible to drive
it to a stack-overrun crash. Add a check to prevent that.
Per bug #17583 from Egor Chindyaskin. Back-patch to all supported
branches.
Richard Guo
Discussion: https://postgr.es/m/[email protected]
M src/backend/parser/parse_clause.c
Add missing fields to _outConstraint()
commit : 2db574a2184e5e6ae289e48079e8523c9cbdc8c4
author : Peter Eisentraut <[email protected]>
date : Sat, 13 Aug 2022 10:32:38 +0200
committer: Peter Eisentraut <[email protected]>
date : Sat, 13 Aug 2022 10:32:38 +0200
As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can
be declared invalid. But that patch didn't update _outConstraint() to
also show the relevant struct fields (which were only applicable to
foreign keys before that). This currently only affects debugging
output, so no impact in practice.
M src/backend/nodes/outfuncs.c
pg_upgrade: Fix some minor code issues
commit : 08c5c6d2833bfae8a27ed7ab3f66513b735321bb
author : Peter Eisentraut <[email protected]>
date : Sat, 13 Aug 2022 00:00:41 +0200
committer: Peter Eisentraut <[email protected]>
date : Sat, 13 Aug 2022 00:00:41 +0200
96ef3b8ff1cf1950e897fd2f766d4bd9ef0d5d56 accidentally copied a not
applicable comment from the float8_pass_by_value code to the
data_checksums code. Remove that.
87d3b35a1ca31a9d947a8f919a6006679216dff0 changed pg_upgrade to
checking the checksum version rather than just the Boolean presence of
checksums, but didn't change the field type in its ControlData struct
from bool. So this would not work correctly if there ever is a
checksum version larger than 1.
M src/bin/pg_upgrade/controldata.c
M src/bin/pg_upgrade/pg_upgrade.h
doc: add missing role attributes to user management section
commit : 88b54b07916c58c7cd20cc0998dc2c62c060a1f7
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 15:43:23 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 15:43:23 -0400
Reported-by: Shinya Kato
Discussion: https://postgr.es/m/[email protected]
Author: Shinya Kato
Backpatch-through: 10
M doc/src/sgml/user-manag.sgml
doc: add section about heap-only tuples (HOT)
commit : 675a368a35a1ae4aa2c54fbd2a8310e3939d73b8
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 15:05:13 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 15:05:13 -0400
Reported-by: Jonathan S. Katz
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 11
M doc/src/sgml/acronyms.sgml
M doc/src/sgml/btree.sgml
M doc/src/sgml/catalogs.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/indexam.sgml
M doc/src/sgml/indices.sgml
M doc/src/sgml/monitoring.sgml
M doc/src/sgml/ref/create_table.sgml
M doc/src/sgml/storage.sgml
doc: warn about security issues around log files
commit : 9039e34e7ed26710e49b4c43d8859387cf4f4faf
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 12:02:20 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 12:02:20 -0400
Reported-by: Simon Riggs
Discussion: https://postgr.es/m/CANP8+jJESuuXYq9Djvf-+tx2vY2OFLmfEuu+UvwHNJ1RT7iJCQ@mail.gmail.com
Author: Simon Riggs
Backpatch-through: 10
M doc/src/sgml/config.sgml
M doc/src/sgml/maintenance.sgml
doc: clarify configuration file for Windows builds
commit : ec98eac9873bd50d75fc51a440848d07ba158d8f
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 11:35:23 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 11:35:23 -0400
The use of file 'config.pl' was not clearly explained.
Reported-by: [email protected]
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/install-windows.sgml
doc: document the CREATE INDEX "USING" clause
commit : e6f7892914ab70b40a2ffa71887e3bdcfa668988
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 11:26:03 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 11:26:03 -0400
Somehow this was in the syntax but had no description.
Reported-by: [email protected]
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/ref/create_index.sgml
doc: clarify CREATE TABLE AS ... IF NOT EXISTS
commit : ff48a0c80ec8dc47ba59161b43058ddcdfbe5b09
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 10:59:00 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 10:59:00 -0400
Mention that the table is not modified if it already exists.
Reported-by: [email protected]
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 10
M doc/src/sgml/ref/create_table_as.sgml
doc: improve wal_level docs for the 'minimal' level
commit : a8fade6cb5ecadca939b2ced770d809631fddd89
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 10:30:01 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 10:30:01 -0400
Reported-by: David G. Johnston
Discussion: https://postgr.es/m/CAKFQuwZ24UcfkoyLLSW3PMGQATomOcw1nuYFRuMev-NoOF+mYw@mail.gmail.com
Author: David G. Johnston
Backpatch-through: 14, partial to 13
M doc/src/sgml/config.sgml
doc: clarify DROP EXTENSION dependent members text
commit : ec3530f4597540cec9d6ccdb2290899822581128
author : Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 09:06:48 -0400
committer: Bruce Momjian <[email protected]>
date : Fri, 12 Aug 2022 09:06:48 -0400
Member tracking was added in PG 13.
Reported-by: David G. Johnston
Discussion: https://postgr.es/m/CAKFQuwY1YtxQHVWUFYvSnOjZ5VPpXjF33V52bSKEwFjK2K=1Aw@mail.gmail.com
Author: David G. Johnston
Backpatch-through: 13
M doc/src/sgml/ref/drop_extension.sgml
Fix _outConstraint() for "identity" constraints
commit : 3f4069ca2c3efdc5d945fb7a4a5b4a1ecd176719
author : Peter Eisentraut <[email protected]>
date : Fri, 12 Aug 2022 08:17:30 +0200
committer: Peter Eisentraut <[email protected]>
date : Fri, 12 Aug 2022 08:17:30 +0200
The set of fields printed by _outConstraint() in the CONSTR_IDENTITY
case didn't match the set of fields actually used in that case. (The
code was probably uncarefully copied from the CONSTR_DEFAULT case.)
Fix that by using the right set of fields. Since there is no read
support for this node type, this is really just for debugging output
right now, so it doesn't affect anything important.
M src/backend/nodes/outfuncs.c
Back-Patch "Add wait_for_subscription_sync for TAP tests."
commit : e082ef9c4282d4dd9c15585ef7a4da30db1289d5
author : Amit Kapila <[email protected]>
date : Fri, 12 Aug 2022 11:16:35 +0530
committer: Amit Kapila <[email protected]>
date : Fri, 12 Aug 2022 11:16:35 +0530
This was originally done in commit 0c20dd33db for 16 only, to eliminate
duplicate code and as an infrastructure that makes it easier to write
future tests. However, it has been suggested that it would be good to
back-patch this testing infrastructure to aid future tests in
back-branches.
Backpatch to all supported versions.
Author: Masahiko Sawada
Reviewed by: Amit Kapila, Shi yu
Discussion: https://postgr.es/m/CAD21AoC-fvAkaKHa4t1urupwL8xbAcWRePeETvshvy80f6WV1A@mail.gmail.com
Discussion: https://postgr.es/m/[email protected]
M src/test/perl/PostgresNode.pm
M src/test/subscription/t/001_rep_changes.pl
M src/test/subscription/t/002_types.pl
M src/test/subscription/t/004_sync.pl
M src/test/subscription/t/005_encoding.pl
M src/test/subscription/t/006_rewrite.pl
M src/test/subscription/t/008_diff_schema.pl
M src/test/subscription/t/010_truncate.pl
M src/test/subscription/t/011_generated.pl
M src/test/subscription/t/013_partition.pl
M src/test/subscription/t/014_binary.pl
M src/test/subscription/t/015_stream.pl
M src/test/subscription/t/016_stream_subxact.pl
M src/test/subscription/t/017_stream_ddl.pl
M src/test/subscription/t/018_stream_subxact_abort.pl
M src/test/subscription/t/019_stream_subxact_ddl_abort.pl
M src/test/subscription/t/021_alter_sub_pub.pl
M src/test/subscription/t/100_bugs.pl
Fix catalog lookup with the wrong snapshot during logical decoding.
commit : 68dcce247f1a13318613a0e27782b2ca21a4ceb7
author : Amit Kapila <[email protected]>
date : Thu, 11 Aug 2022 09:45:04 +0530
committer: Amit Kapila <[email protected]>
date : Thu, 11 Aug 2022 09:45:04 +0530
Previously, we relied on HEAP2_NEW_CID records and XACT_INVALIDATION
records to know if the transaction has modified the catalog, and that
information is not serialized to snapshot. Therefore, after the restart,
if the logical decoding decodes only the commit record of the transaction
that has actually modified a catalog, we will miss adding its XID to the
snapshot. Thus, we will end up looking at catalogs with the wrong
snapshot.
To fix this problem, this changes the snapshot builder so that it
remembers the last-running-xacts list of the decoded RUNNING_XACTS record
after restoring the previously serialized snapshot. Then, we mark the
transaction as containing catalog changes if it's in the list of initial
running transactions and its commit record has XACT_XINFO_HAS_INVALS. To
avoid ABI breakage, we store the array of the initial running transactions
in the static variables InitialRunningXacts and NInitialRunningXacts,
instead of storing those in SnapBuild or ReorderBuffer.
This approach has a false positive; we could end up adding the transaction
that didn't change catalog to the snapshot since we cannot distinguish
whether the transaction has catalog changes only by checking the COMMIT
record. It doesn't have the information on which (sub) transaction has
catalog changes, and XACT_XINFO_HAS_INVALS doesn't necessarily indicate
that the transaction has catalog change. But that won't be a problem since
we use snapshot built during decoding only to read system catalogs.
On the master branch, we took a more future-proof approach by writing
catalog modifying transactions to the serialized snapshot which avoids the
above false positive. But we cannot backpatch it because of a change in
the SnapBuild.
Reported-by: Mike Oh
Author: Masahiko Sawada
Reviewed-by: Amit Kapila, Shi yu, Takamichi Osumi, Kyotaro Horiguchi, Bertrand Drouvot, Ahsan Hadi
Backpatch-through: 10
Discussion: https://postgr.es/m/81D0D8B0-E7C4-4999-B616-1E5004DBDCD2%40amazon.com
M contrib/test_decoding/Makefile
A contrib/test_decoding/expected/catalog_change_snapshot.out
A contrib/test_decoding/specs/catalog_change_snapshot.spec
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/snapbuild.c
M src/include/replication/snapbuild.h
Fix handling of R/W expanded datums that are passed to SQL functions.
commit : 95bfadd4e83c17f1a31ab97eb2aba44a38c36324
author : Tom Lane <[email protected]>
date : Wed, 10 Aug 2022 13:37:25 -0400
committer: Tom Lane <[email protected]>
date : Wed, 10 Aug 2022 13:37:25 -0400
fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function. If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.
From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.
Per report from Adam Mackler. This has been broken since we
invented expanded datums, so back-patch to all supported branches.
Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjOcrevYEDeoAvz6nR0IU4IHhXnaCA=@mackler.email
Discussion: https://postgr.es/m/[email protected]
M src/backend/executor/functions.c
M src/test/regress/expected/create_function_3.out
M src/test/regress/sql/create_function_3.sql