pgsql: Reset the logical worker type while cleaning up other worker inf

2023-08-24 Thread Amit Kapila
Reset the logical worker type while cleaning up other worker info. Commit 2a8b40e36 introduces the worker type field for logical replication workers, but forgot to reset the type when the worker exits. This can lead to recognizing a stopped worker as a valid logical replication worker. Fix it by

pgsql: doc: PG 16 relnotes: fix initdb encoding/locale item

2023-08-24 Thread Bruce Momjian
doc: PG 16 relnotes: fix initdb encoding/locale item Reported-by: Jeff Davis Discussion: https://postgr.es/m/c5369641862637c71a6c1c440ac7f122068ca4e7.ca...@j-davis.com Backpatch-through: 16 only Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a842ba407c37

pgsql: Use "template" data directory in tests

2023-08-24 Thread Andres Freund
Use "template" data directory in tests When running all (or just many) of our tests, a significant portion of both CPU time and IO is spent running initdb. Most of those initdb runs don't specify any options influencing properties of the created data directory. Avoid most of that overhead by crea

Re: pgsql: Cache by-reference missing values in a long lived context

2023-08-24 Thread Tom Lane
Andrew Dunstan writes: > On 2023-08-24 Th 11:27, Tom Lane wrote: >> The v11 version of this patch is causing a compiler warning for me: > Sorry about that, fixed. Thanks! > While we're about it, let's also fix these warnings which are seen on my > systems building releases 11 and 12: > /home/

Re: pgsql: Cache by-reference missing values in a long lived context

2023-08-24 Thread Andrew Dunstan
On 2023-08-24 Th 11:27, Tom Lane wrote: Andrew Dunstan writes: Cache by-reference missing values in a long lived context The v11 version of this patch is causing a compiler warning for me: In file included from heaptuple.c:58: heaptuple.c: In function 'missing_hash': heaptuple.c:97:3: warnin

pgsql: Include header file inadvertently missed in commit 2d13dab048

2023-08-24 Thread Andrew Dunstan
Include header file inadvertently missed in commit 2d13dab048 per gripe from Tom Lane. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b915bf495ff48c4f57a22a90dfddc38be7a9845e Modified Files -- src/backend/access/common/heaptuple.c | 1 + 1 file c

pgsql: pg_upgrade: Bump MESSAGE_WIDTH.

2023-08-24 Thread Nathan Bossart
pg_upgrade: Bump MESSAGE_WIDTH. Commit 7b378237aa added a status message to pg_upgrade that is 60 characters wide. Since the MESSAGE_WIDTH macro is currently set to 60, there is no space between this new status message and the "ok" or "failed" indicator appended when the step completes. To fix t

pgsql: pg_upgrade: Bump MESSAGE_WIDTH.

2023-08-24 Thread Nathan Bossart
pg_upgrade: Bump MESSAGE_WIDTH. Commit 7b378237aa added a status message to pg_upgrade that is 60 characters wide. Since the MESSAGE_WIDTH macro is currently set to 60, there is no space between this new status message and the "ok" or "failed" indicator appended when the step completes. To fix t

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

pgsql: Avoid unnecessary plancache revalidation of utility statements.

2023-08-24 Thread Tom Lane
Avoid unnecessary plancache revalidation of utility statements. Revalidation of a plancache entry (after a cache invalidation event) requires acquiring a snapshot. Normally that is harmless, but not if the cached statement is one that needs to run without acquiring a snapshot. We were already aw

Re: pgsql: Cache by-reference missing values in a long lived context

2023-08-24 Thread Tom Lane
Andrew Dunstan writes: > Cache by-reference missing values in a long lived context The v11 version of this patch is causing a compiler warning for me: In file included from heaptuple.c:58: heaptuple.c: In function 'missing_hash': heaptuple.c:97:3: warning: implicit declaration of function 'hash_

pgsql: Add test for inherited CHECK constraint drop

2023-08-24 Thread Alvaro Herrera
Add test for inherited CHECK constraint drop This code is insufficiently covered by tests, so add a few small test cases to immortalize its behavior before it gets rewritten completely by the project to catalog NOT NULL constraints. Branch -- master Details --- https://git.postgresql.org

pgsql: Use FD_CLOEXEC on ListenSockets

2023-08-24 Thread Heikki Linnakangas
Use FD_CLOEXEC on ListenSockets It's good hygiene if e.g. an extension launches a subprogram when being loaded. We went through some effort to close them in the child process in EXEC_BACKEND mode, but it's better to not hand them down to the child process in the first place. We still need to close

pgsql: Fix lack of message pluralization

2023-08-24 Thread Peter Eisentraut
Fix lack of message pluralization Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d71e6055e45318b5cff2094025d641b954517fa9 Modified Files -- src/backend/replication/slot.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-)

pgsql: Fix lack of message pluralization

2023-08-24 Thread Peter Eisentraut
Fix lack of message pluralization Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/ce18252d0b48d206d42cfbe1028e48d776e01831 Modified Files -- src/backend/replication/slot.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-)

pgsql: Update DECLARE_INDEX documentation

2023-08-24 Thread Peter Eisentraut
Update DECLARE_INDEX documentation Update source code comment changes belonging to the changes in 6a6389a08b. Discussion: https://www.postgresql.org/message-id/flat/75ae5875-3abc-dafc-8aec-73247ed41...@eisentraut.org Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/com

pgsql: Update DECLARE_INDEX documentation

2023-08-24 Thread Peter Eisentraut
Update DECLARE_INDEX documentation Update source code comment changes belonging to the changes in 6a6389a08b. Discussion: https://www.postgresql.org/message-id/flat/75ae5875-3abc-dafc-8aec-73247ed41...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Update DECLARE_INDEX documentation

2023-08-24 Thread Peter Eisentraut
Update DECLARE_INDEX documentation Update source code comment changes belonging to the changes in 6a6389a08b. Discussion: https://www.postgresql.org/message-id/flat/75ae5875-3abc-dafc-8aec-73247ed41...@eisentraut.org Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/com

pgsql: Rename hook functions for debug_io_direct to match variable name

2023-08-24 Thread Thomas Munro
Rename hook functions for debug_io_direct to match variable name. Commit 319bae9a renamed the GUC. Rename the check and assign functions to match, and alphabetize. Back-patch to 16. Author: Peter Eisentraut Discussion: https://postgr.es/m/2769341e-fa28-c2ee-3e4b-53fdcaaf2271%40eisentraut.org

pgsql: Rename hook functions for debug_io_direct to match variable name

2023-08-24 Thread Thomas Munro
Rename hook functions for debug_io_direct to match variable name. Commit 319bae9a renamed the GUC. Rename the check and assign functions to match, and alphabetize. Back-patch to 16. Author: Peter Eisentraut Discussion: https://postgr.es/m/2769341e-fa28-c2ee-3e4b-53fdcaaf2271%40eisentraut.org

pgsql: Add proargnames to multi-argument aggregate functions

2023-08-24 Thread Daniel Gustafsson
Add proargnames to multi-argument aggregate functions Having argument names makes it easier to understand how to use the aggregate functions when inspecting them with \dfa or similar. Author: Dagfinn Ilmari Mannsåker Reviewed-by: Vik Fearing Reviewed-by: Jim Jones Discussion: https://postgr.es

pgsql: Fix the error message when failing to restore the snapshot.

2023-08-24 Thread Amit Kapila
Fix the error message when failing to restore the snapshot. The SnapBuildRestoreContents() used a const value in the error message to indicate the size in bytes it was expecting to read from the serialized snapshot file. Fix it by reporting the size that was actually passed. Author: Hou Zhijie Re

pgsql: Fix the error message when failing to restore the snapshot.

2023-08-24 Thread Amit Kapila
Fix the error message when failing to restore the snapshot. The SnapBuildRestoreContents() used a const value in the error message to indicate the size in bytes it was expecting to read from the serialized snapshot file. Fix it by reporting the size that was actually passed. Author: Hou Zhijie Re

pgsql: Fix translation markers

2023-08-24 Thread Peter Eisentraut
Fix translation markers Conditionals cannot be inside gettext trigger functions, they must be applied outside. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9efcf442b9a4035be2692525be81a23224288d1b Modified Files -- src/backend/parser/parse_expr.c | 6

pgsql: Fix translation markers

2023-08-24 Thread Peter Eisentraut
Fix translation markers Conditionals cannot be inside gettext trigger functions, they must be applied outside. Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/8179d1bdf7763bab8a55022268bcfada011e8a4f Modified Files -- src/backend/parser/parse_exp