pgsql: Add context type field to pg_backend_memory_contexts

2024-07-01 Thread David Rowley
Add context type field to pg_backend_memory_contexts Since we now (as of v17) have 4 MemoryContext types, the type of context seems like useful information to include in the pg_backend_memory_contexts view. Here we add that. Reviewed-by: David Christensen, Michael Paquier Discussion: https://po

pgsql: Fix copy-paste mistake in PQcancelCreate

2024-07-01 Thread Alvaro Herrera
Fix copy-paste mistake in PQcancelCreate When an OOM occurred, this function was incorrectly setting a status of CONNECTION_BAD on the passed in PGconn instead of on the newly created PGcancelConn. Mistake introduced with 61461a300c1c. Backpatch to 17. Author: Jelte Fennema-Nio Reported-by: No

pgsql: Fix copy-paste mistake in PQcancelCreate

2024-07-01 Thread Alvaro Herrera
Fix copy-paste mistake in PQcancelCreate When an OOM occurred, this function was incorrectly setting a status of CONNECTION_BAD on the passed in PGconn instead of on the newly created PGcancelConn. Mistake introduced with 61461a300c1c. Backpatch to 17. Author: Jelte Fennema-Nio Reported-by: No

pgsql: Remove useless extern keywords

2024-07-01 Thread Peter Eisentraut
Remove useless extern keywords An extern keyword on a function definition (not declaration) is useless and not the normal style. Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch -- master Details --- https://git.postgresq

pgsql: Add --no-sync to pg_upgrade's uses of pg_dump and pg_dumpall.

2024-07-01 Thread Nathan Bossart
Add --no-sync to pg_upgrade's uses of pg_dump and pg_dumpall. There's no reason to ensure that the files pg_upgrade generates with pg_dump and pg_dumpall have been written safely to disk. If there is a crash during pg_upgrade, the upgrade must be restarted from the beginning; dump files left behi

pgsql: Preserve CurrentMemoryContext across Start/CommitTransactionComm

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across Start/CommitTransactionCommand. Up to now, committing a transaction has caused CurrentMemoryContext to get set to TopMemoryContext. Most callers did not pay any particular heed to this, which is problematic because TopMemoryContext is a long-lived context that

pgsql: Preserve CurrentMemoryContext across notify and sinval interrupt

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across notify and sinval interrupts. ProcessIncomingNotify is called from the main processing loop that normally runs in MessageContext. That outer-loop code assumes that whatever it allocates will be cleaned up when we're done processing the current client message -

pgsql: Preserve CurrentMemoryContext across notify and sinval interrupt

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across notify and sinval interrupts. ProcessIncomingNotify is called from the main processing loop that normally runs in MessageContext. That outer-loop code assumes that whatever it allocates will be cleaned up when we're done processing the current client message -

pgsql: Preserve CurrentMemoryContext across notify and sinval interrupt

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across notify and sinval interrupts. ProcessIncomingNotify is called from the main processing loop that normally runs in MessageContext. That outer-loop code assumes that whatever it allocates will be cleaned up when we're done processing the current client message -

pgsql: Preserve CurrentMemoryContext across notify and sinval interrupt

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across notify and sinval interrupts. ProcessIncomingNotify is called from the main processing loop that normally runs in MessageContext. That outer-loop code assumes that whatever it allocates will be cleaned up when we're done processing the current client message -

pgsql: Preserve CurrentMemoryContext across notify and sinval interrupt

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across notify and sinval interrupts. ProcessIncomingNotify is called from the main processing loop that normally runs in MessageContext. That outer-loop code assumes that whatever it allocates will be cleaned up when we're done processing the current client message -

pgsql: Preserve CurrentMemoryContext across notify and sinval interrupt

2024-07-01 Thread Tom Lane
Preserve CurrentMemoryContext across notify and sinval interrupts. ProcessIncomingNotify is called from the main processing loop that normally runs in MessageContext. That outer-loop code assumes that whatever it allocates will be cleaned up when we're done processing the current client message -

pgsql: Fix missing installation/uninstallation rules for BackgroundPsql

2024-07-01 Thread Heikki Linnakangas
Fix missing installation/uninstallation rules for BackgroundPsql.pm Commit d5fd7865 backported BackgroundPsql perl module module with helper functions for tests running interactive or background psql tasks to PG 12 to 15, but did not add installation/uninstallation rules of the build system, causi

pgsql: Fix missing installation/uninstallation rules for BackgroundPsql

2024-07-01 Thread Heikki Linnakangas
Fix missing installation/uninstallation rules for BackgroundPsql.pm Commit d5fd7865 backported BackgroundPsql perl module module with helper functions for tests running interactive or background psql tasks to PG 12 to 15, but did not add installation/uninstallation rules of the build system, causi

pgsql: Fix missing installation/uninstallation rules for BackgroundPsql

2024-07-01 Thread Heikki Linnakangas
Fix missing installation/uninstallation rules for BackgroundPsql.pm Commit d5fd7865 backported BackgroundPsql perl module module with helper functions for tests running interactive or background psql tasks to PG 12 to 15, but did not add installation/uninstallation rules of the build system, causi

pgsql: Fix missing installation/uninstallation rules for BackgroundPsql

2024-07-01 Thread Heikki Linnakangas
Fix missing installation/uninstallation rules for BackgroundPsql.pm Commit d5fd7865 backported BackgroundPsql perl module module with helper functions for tests running interactive or background psql tasks to PG 12 to 15, but did not add installation/uninstallation rules of the build system, causi

pgsql: Remove redundant privilege check from pg_sequences system view.

2024-07-01 Thread Nathan Bossart
Remove redundant privilege check from pg_sequences system view. This commit adjusts pg_sequence_last_value() to return NULL instead of ERROR-ing for sequences for which the current user lacks privileges. This allows us to remove the call to has_sequence_privilege() in the definition of the pg_seq

pgsql: Remove support for HPPA (a/k/a PA-RISC) architecture.

2024-07-01 Thread Tom Lane
Remove support for HPPA (a/k/a PA-RISC) architecture. This old CPU architecture hasn't been produced in decades, and whatever instances might still survive are surely too underpowered for anyone to consider running Postgres on in production. We'd nonetheless continued to carry code support for it

pgsql: Add information about access method for partitioned relations in

2024-07-01 Thread Michael Paquier
Add information about access method for partitioned relations in \dP+ Since 374c7a229042, it is possible to set a table AM on a partitioned table. This information was showing up already in psql with \d+, while \dP+ provided no information. This commit extends \dP+ to show the access method used

pgsql: Cleanup perl code from unused variables and routines

2024-07-01 Thread Michael Paquier
Cleanup perl code from unused variables and routines This commit removes unused variables and routines from some perl code that have accumulated across the years. This touches the following areas: - Wait event generation script. - AdjustUpgrade.pm. - TAP perl code Author: Alexander Lakhin Review

pgsql: Use TupleDescAttr macro consistently

2024-07-01 Thread David Rowley
Use TupleDescAttr macro consistently A few places were directly accessing the attrs[] array. This goes against the standards set by 2cd708452. Fix that. Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=m0rhds+4...@mail.gmail.com Branch -- master Details --- https

pgsql: Update release notes to reflect recent commit 0f934b0739.

2024-07-01 Thread Amit Kapila
Update release notes to reflect recent commit 0f934b0739. Author: Hou Zhijie Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/os3pr01mb57187b959c1ecc78b0c7c91a94...@os3pr01mb5718.jpnprd01.prod.outlook.com Branch -- REL_17_STABLE Details --- htt

pgsql: Remove unused structure member in pg_createsubscriber.c.

2024-07-01 Thread Amit Kapila
Remove unused structure member in pg_createsubscriber.c. Author: Kuroda Hayato Backpatch-through: 17 Discussion: https://postgr.es/m/osbpr01mb25526a30a1fbf863accdda3af5...@osbpr01mb2552.jpnprd01.prod.outlook.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a4c87

pgsql: Remove unused structure member in pg_createsubscriber.c.

2024-07-01 Thread Amit Kapila
Remove unused structure member in pg_createsubscriber.c. Author: Kuroda Hayato Backpatch-through: 17 Discussion: https://postgr.es/m/osbpr01mb25526a30a1fbf863accdda3af5...@osbpr01mb2552.jpnprd01.prod.outlook.com Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdif

pgsql: Add missing includes for some global variables

2024-07-01 Thread Peter Eisentraut
Add missing includes for some global variables src/backend/libpq/pqcomm.c: "postmaster/postmaster.h" for Unix_socket_group, Unix_socket_permissions src/backend/utils/init/globals.c: "postmaster/postmaster.h" for MyClientSocket src/backend/utils/misc/guc_tables.c: "utils/rls.h" for row_security sr

pgsql: Improve some global variable declarations

2024-07-01 Thread Peter Eisentraut
Improve some global variable declarations We have in launch_backend.c: /* * The following need to be available to the save/restore_backend_variables * functions. They are marked NON_EXEC_STATIC in their home modules. */ extern slock_t *ShmemLock; extern slock_t *ProcSt

pgsql: Convert some extern variables to static

2024-07-01 Thread Peter Eisentraut
Convert some extern variables to static These probably should have been static all along, it was only forgotten out of sloppiness. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch -- master Details

pgsql: Drop pre-existing subscriptions from the converted subscriber.

2024-07-01 Thread Amit Kapila
Drop pre-existing subscriptions from the converted subscriber. We don't need the pre-existing subscriptions on the newly formed subscriber by using pg_createsubscriber. The apply workers corresponding to these subscriptions can connect to other publisher nodes and either get some unwarranted data

pgsql: Drop pre-existing subscriptions from the converted subscriber.

2024-07-01 Thread Amit Kapila
Drop pre-existing subscriptions from the converted subscriber. We don't need the pre-existing subscriptions on the newly formed subscriber by using pg_createsubscriber. The apply workers corresponding to these subscriptions can connect to other publisher nodes and either get some unwarranted data