pgsql: Revert inappropriate weakening of an Assert in plpgsql.

2025-03-27 Thread Tom Lane
Revert inappropriate weakening of an Assert in plpgsql. Commit 682ce911f modified exec_save_simple_expr to accept a Param in the tlist of a Gather node, rather than the normal case of a Var referencing the Gather's input. It turns out that this was a kluge to work around the bug later fixed in 0f

pgsql: Provide thread-safe pg_localeconv_r().

2025-03-27 Thread Peter Eisentraut
Provide thread-safe pg_localeconv_r(). This involves four different implementation strategies: 1. For Windows, we now require _configthreadlocale() to be available and work (commit f1da075d9a0), and the documentation says that the object returned by localeconv() is in thread-local memory. 2. F

pgsql: Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT

2025-03-27 Thread Álvaro Herrera
Simplify syntax for ALTER TABLE ALTER CONSTRAINT NO INHERIT Commit d45597f72fe5 introduced the ability to change a not-null constraint from NO INHERIT to INHERIT and vice versa, but we included the SET noise word in the syntax for it. The SET turns out not to be necessary and goes against what th

pgsql: Use streaming read I/O in heap amcheck

2025-03-27 Thread Melanie Plageman
Use streaming read I/O in heap amcheck Instead of directly invoking ReadBuffer() for each unskippable block in the heap relation, verify_heapam() now uses the read stream API to acquire the next buffer to check for corruption. Author: Matheus Alcantara Co-authored-by: Melanie Plageman Reviewed-

pgsql: Prevent assertion failure in contrib/pg_freespacemap.

2025-03-27 Thread Tom Lane
Prevent assertion failure in contrib/pg_freespacemap. Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check for that case. Bug: #18866 Reported-by: Robins Tharakan Author:

pgsql: Prevent assertion failure in contrib/pg_freespacemap.

2025-03-27 Thread Tom Lane
Prevent assertion failure in contrib/pg_freespacemap. Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check for that case. Bug: #18866 Reported-by: Robins Tharakan Author:

pgsql: Prevent assertion failure in contrib/pg_freespacemap.

2025-03-27 Thread Tom Lane
Prevent assertion failure in contrib/pg_freespacemap. Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check for that case. Bug: #18866 Reported-by: Robins Tharakan Author:

pgsql: Prevent assertion failure in contrib/pg_freespacemap.

2025-03-27 Thread Tom Lane
Prevent assertion failure in contrib/pg_freespacemap. Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check for that case. Bug: #18866 Reported-by: Robins Tharakan Author:

pgsql: Prevent assertion failure in contrib/pg_freespacemap.

2025-03-27 Thread Tom Lane
Prevent assertion failure in contrib/pg_freespacemap. Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check for that case. Bug: #18866 Reported-by: Robins Tharakan Author:

pgsql: Prevent assertion failure in contrib/pg_freespacemap.

2025-03-27 Thread Tom Lane
Prevent assertion failure in contrib/pg_freespacemap. Applying pg_freespacemap() to a relation lacking storage (such as a view) caused an assertion failure, although there was no ill effect in non-assert builds. Add an error check for that case. Bug: #18866 Reported-by: Robins Tharakan Author:

pgsql: Stablize tests added in 3abe9dc188.

2025-03-27 Thread Amit Kapila
Stablize tests added in 3abe9dc188. The problem is that after the ALTER SUBSCRIPTION tap_sub SET PUBLICATION command, we didn't wait for the new walsender to start on the publisher. Immediately after ALTER, we performed Insert and expected it to replicate. However, the replication could start from

pgsql: Fix guc_malloc calls for consistency and OOM checks

2025-03-27 Thread Daniel Gustafsson
Fix guc_malloc calls for consistency and OOM checks check_createrole_self_grant and check_synchronized_standby_slots were allocating memory on a LOG elevel without checking if the allocation succeeded or not, which would have led to a segfault on allocation failure. On top of that, a number of ca

pgsql: Fix guc_malloc calls for consistency and OOM checks

2025-03-27 Thread Daniel Gustafsson
Fix guc_malloc calls for consistency and OOM checks check_createrole_self_grant and check_synchronized_standby_slots were allocating memory on a LOG elevel without checking if the allocation succeeded or not, which would have led to a segfault on allocation failure. On top of that, a number of ca

pgsql: Fix guc_malloc calls for consistency and OOM checks

2025-03-27 Thread Daniel Gustafsson
Fix guc_malloc calls for consistency and OOM checks check_createrole_self_grant and check_synchronized_standby_slots were allocating memory on a LOG elevel without checking if the allocation succeeded or not, which would have led to a segfault on allocation failure. On top of that, a number of ca

pgsql: libpq: Add TAP tests for service files and names

2025-03-27 Thread Michael Paquier
libpq: Add TAP tests for service files and names This commit adds a set of regression tests that checks various patterns with service names and service files, with: - Service file with no contents, used as default for PGSERVICEFILE to prevent any lookups at the HOME directory of an environment whe

pgsql: Expand test a bit

2025-03-27 Thread Peter Eisentraut
Expand test a bit Make pg_constraint output in inherit test show the convalidated column as well. This shows the interaction between convalidated and conenforced. This is extracted from a larger patch so that this reformatting isn't distracting there. Author: Amul Sul Discussion: https://www.

pgsql: Remove the query_id_squash_values GUC

2025-03-27 Thread Álvaro Herrera
Remove the query_id_squash_values GUC Commit 62d712ecfd94 introduced the capability to calculate the same queryId for queries with different lengths of constants in a list for an IN clause. This behavior was originally enabled with a GUC query_id_squash_values. After a discussion about the value

pgsql: psql: Fix incorrect equality comparison

2025-03-27 Thread Daniel Gustafsson
psql: Fix incorrect equality comparison Commit 1a759c83278 contained an incorrect equality comparison which was discovered by Coverity. Reported-by: Ranier Vilela Discussion: https://postgr.es/m/caeudqapfawzlo+osuy2byxktdr7r8kjc_act5vv8fontrl3...@mail.gmail.com Branch -- master Details --

pgsql: pg_overexplain: Filter out actual row count from test result.

2025-03-27 Thread Robert Haas
pg_overexplain: Filter out actual row count from test result. Per buildfarm, these are not stable. In particular, 1/8 is sometimes 0.12 and sometimes 0.13. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/081ec08e6a148b06a0179bf8ac50524b1f142b68 Modified Files -