pgsql: Change internal plan ID type from uint64 to int64

2025-05-30 Thread Michael Paquier
Change internal plan ID type from uint64 to int64 uint64 was chosen to be consistent with the type used by the query ID, but the conclusion of a recent discussion for the query ID is that int64 is a better fit as the signed form is shown to the user, for PGSS or EXPLAIN outputs. This commit chang

pgsql: Ensure we have a snapshot when updating various system catalogs.

2025-05-30 Thread Nathan Bossart
Ensure we have a snapshot when updating various system catalogs. A few places that access system catalogs don't set up an active snapshot before potentially accessing their TOAST tables. To fix, push an active snapshot just before each section of code that might require accessing one of these TOA

pgsql: Ensure we have a snapshot when updating various system catalogs.

2025-05-30 Thread Nathan Bossart
Ensure we have a snapshot when updating various system catalogs. A few places that access system catalogs don't set up an active snapshot before potentially accessing their TOAST tables. To fix, push an active snapshot just before each section of code that might require accessing one of these TOA

pgsql: Ensure we have a snapshot when updating various system catalogs.

2025-05-30 Thread Nathan Bossart
Ensure we have a snapshot when updating various system catalogs. A few places that access system catalogs don't set up an active snapshot before potentially accessing their TOAST tables. To fix, push an active snapshot just before each section of code that might require accessing one of these TOA

pgsql: Ensure we have a snapshot when updating various system catalogs.

2025-05-30 Thread Nathan Bossart
Ensure we have a snapshot when updating various system catalogs. A few places that access system catalogs don't set up an active snapshot before potentially accessing their TOAST tables. To fix, push an active snapshot just before each section of code that might require accessing one of these TOA

pgsql: Ensure we have a snapshot when updating various system catalogs.

2025-05-30 Thread Nathan Bossart
Ensure we have a snapshot when updating various system catalogs. A few places that access system catalogs don't set up an active snapshot before potentially accessing their TOAST tables. To fix, push an active snapshot just before each section of code that might require accessing one of these TOA

pgsql: Ensure we have a snapshot when updating various system catalogs.

2025-05-30 Thread Nathan Bossart
Ensure we have a snapshot when updating various system catalogs. A few places that access system catalogs don't set up an active snapshot before potentially accessing their TOAST tables. To fix, push an active snapshot just before each section of code that might require accessing one of these TOA

pgsql: Fix memory leakage in postgres_fdw's DirectModify code path.

2025-05-30 Thread Tom Lane
Fix memory leakage in postgres_fdw's DirectModify code path. postgres_fdw tries to use PG_TRY blocks to ensure that it will eventually free the PGresult created by the remote modify command. However, it's fundamentally impossible for this scheme to work reliably when there's RETURNING data, becaus

pgsql: Fix memory leakage in postgres_fdw's DirectModify code path.

2025-05-30 Thread Tom Lane
Fix memory leakage in postgres_fdw's DirectModify code path. postgres_fdw tries to use PG_TRY blocks to ensure that it will eventually free the PGresult created by the remote modify command. However, it's fundamentally impossible for this scheme to work reliably when there's RETURNING data, becaus

pgsql: Fix memory leakage in postgres_fdw's DirectModify code path.

2025-05-30 Thread Tom Lane
Fix memory leakage in postgres_fdw's DirectModify code path. postgres_fdw tries to use PG_TRY blocks to ensure that it will eventually free the PGresult created by the remote modify command. However, it's fundamentally impossible for this scheme to work reliably when there's RETURNING data, becaus

pgsql: Fix memory leakage in postgres_fdw's DirectModify code path.

2025-05-30 Thread Tom Lane
Fix memory leakage in postgres_fdw's DirectModify code path. postgres_fdw tries to use PG_TRY blocks to ensure that it will eventually free the PGresult created by the remote modify command. However, it's fundamentally impossible for this scheme to work reliably when there's RETURNING data, becaus

pgsql: Fix memory leakage in postgres_fdw's DirectModify code path.

2025-05-30 Thread Tom Lane
Fix memory leakage in postgres_fdw's DirectModify code path. postgres_fdw tries to use PG_TRY blocks to ensure that it will eventually free the PGresult created by the remote modify command. However, it's fundamentally impossible for this scheme to work reliably when there's RETURNING data, becaus

pgsql: Fix memory leakage in postgres_fdw's DirectModify code path.

2025-05-30 Thread Tom Lane
Fix memory leakage in postgres_fdw's DirectModify code path. postgres_fdw tries to use PG_TRY blocks to ensure that it will eventually free the PGresult created by the remote modify command. However, it's fundamentally impossible for this scheme to work reliably when there's RETURNING data, becaus

pgsql: Allow larger packets during GSSAPI authentication exchange.

2025-05-30 Thread Tom Lane
Allow larger packets during GSSAPI authentication exchange. Our GSSAPI code only allows packet sizes up to 16kB. However it emerges that during authentication, larger packets might be needed; various authorities suggest 48kB or 64kB as the maximum packet size. This limitation caused login failure

pgsql: Allow larger packets during GSSAPI authentication exchange.

2025-05-30 Thread Tom Lane
Allow larger packets during GSSAPI authentication exchange. Our GSSAPI code only allows packet sizes up to 16kB. However it emerges that during authentication, larger packets might be needed; various authorities suggest 48kB or 64kB as the maximum packet size. This limitation caused login failure

pgsql: Allow larger packets during GSSAPI authentication exchange.

2025-05-30 Thread Tom Lane
Allow larger packets during GSSAPI authentication exchange. Our GSSAPI code only allows packet sizes up to 16kB. However it emerges that during authentication, larger packets might be needed; various authorities suggest 48kB or 64kB as the maximum packet size. This limitation caused login failure

pgsql: Allow larger packets during GSSAPI authentication exchange.

2025-05-30 Thread Tom Lane
Allow larger packets during GSSAPI authentication exchange. Our GSSAPI code only allows packet sizes up to 16kB. However it emerges that during authentication, larger packets might be needed; various authorities suggest 48kB or 64kB as the maximum packet size. This limitation caused login failure

pgsql: Allow larger packets during GSSAPI authentication exchange.

2025-05-30 Thread Tom Lane
Allow larger packets during GSSAPI authentication exchange. Our GSSAPI code only allows packet sizes up to 16kB. However it emerges that during authentication, larger packets might be needed; various authorities suggest 48kB or 64kB as the maximum packet size. This limitation caused login failure

pgsql: Allow larger packets during GSSAPI authentication exchange.

2025-05-30 Thread Tom Lane
Allow larger packets during GSSAPI authentication exchange. Our GSSAPI code only allows packet sizes up to 16kB. However it emerges that during authentication, larger packets might be needed; various authorities suggest 48kB or 64kB as the maximum packet size. This limitation caused login failure

pgsql: Make XactLockTableWait() and ConditionalXactLockTableWait() inte

2025-05-30 Thread Fujii Masao
Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, XactLockTableWait() and ConditionalXactLockTableWait() could enter a non-interruptible loop when they successfully acquired a lock on a transaction but the transaction still appeared to be running. Since th

pgsql: Make XactLockTableWait() and ConditionalXactLockTableWait() inte

2025-05-30 Thread Fujii Masao
Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, XactLockTableWait() and ConditionalXactLockTableWait() could enter a non-interruptible loop when they successfully acquired a lock on a transaction but the transaction still appeared to be running. Since th

pgsql: Make XactLockTableWait() and ConditionalXactLockTableWait() inte

2025-05-30 Thread Fujii Masao
Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, XactLockTableWait() and ConditionalXactLockTableWait() could enter a non-interruptible loop when they successfully acquired a lock on a transaction but the transaction still appeared to be running. Since th

pgsql: Make XactLockTableWait() and ConditionalXactLockTableWait() inte

2025-05-30 Thread Fujii Masao
Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, XactLockTableWait() and ConditionalXactLockTableWait() could enter a non-interruptible loop when they successfully acquired a lock on a transaction but the transaction still appeared to be running. Since th

pgsql: Make XactLockTableWait() and ConditionalXactLockTableWait() inte

2025-05-30 Thread Fujii Masao
Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, XactLockTableWait() and ConditionalXactLockTableWait() could enter a non-interruptible loop when they successfully acquired a lock on a transaction but the transaction still appeared to be running. Since th

pgsql: Make XactLockTableWait() and ConditionalXactLockTableWait() inte

2025-05-30 Thread Fujii Masao
Make XactLockTableWait() and ConditionalXactLockTableWait() interruptable more. Previously, XactLockTableWait() and ConditionalXactLockTableWait() could enter a non-interruptible loop when they successfully acquired a lock on a transaction but the transaction still appeared to be running. Since th

pgsql: Fix broken-FK-detection query in release notes

2025-05-30 Thread Álvaro Herrera
Fix broken-FK-detection query in release notes Commits 53af9491a043 and 2d5fe514052a fixed a number of problems with foreign keys that reference partitioned tables, and a query to detect already broken FKs was supplied with the release notes for 17.1, 16.5, 15.9, 14.14, 13.17. However, that query

pgsql: Fix broken-FK-detection query in release notes

2025-05-30 Thread Álvaro Herrera
Fix broken-FK-detection query in release notes Commits 53af9491a043 and 2d5fe514052a fixed a number of problems with foreign keys that reference partitioned tables, and a query to detect already broken FKs was supplied with the release notes for 17.1, 16.5, 15.9, 14.14, 13.17. However, that query

pgsql: Fix broken-FK-detection query in release notes

2025-05-30 Thread Álvaro Herrera
Fix broken-FK-detection query in release notes Commits 53af9491a043 and 2d5fe514052a fixed a number of problems with foreign keys that reference partitioned tables, and a query to detect already broken FKs was supplied with the release notes for 17.1, 16.5, 15.9, 14.14, 13.17. However, that query

pgsql: Fix broken-FK-detection query in release notes

2025-05-30 Thread Álvaro Herrera
Fix broken-FK-detection query in release notes Commits 53af9491a043 and 2d5fe514052a fixed a number of problems with foreign keys that reference partitioned tables, and a query to detect already broken FKs was supplied with the release notes for 17.1, 16.5, 15.9, 14.14, 13.17. However, that query

pgsql: Fix broken-FK-detection query in release notes

2025-05-30 Thread Álvaro Herrera
Fix broken-FK-detection query in release notes Commits 53af9491a043 and 2d5fe514052a fixed a number of problems with foreign keys that reference partitioned tables, and a query to detect already broken FKs was supplied with the release notes for 17.1, 16.5, 15.9, 14.14, 13.17. However, that query

pgsql: Change internal queryid type from uint64 to int64

2025-05-30 Thread David Rowley
Change internal queryid type from uint64 to int64 uint64 was perhaps chosen in cff440d36 as the type was uint32 prior to that widening work. Having this as uint64 doesn't make much sense and just adds the overhead of having to remember that we always output this in its signed form. Let's remove