pgsql: Add missing EPQ recheck for TID Scan

2025-09-17 Thread David Rowley
Add missing EPQ recheck for TID Scan The EvalPlanQual recheck for TID Scan wasn't rechecking the TID qual still passed after following update chains. This could result in tuples being updated or deleted by plans using TID Scans where the ctid of the new (updated) tuple no longer matches the claus

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-17 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: ci: openbsd: Increase RAM disk's size

2025-09-17 Thread Andres Freund
ci: openbsd: Increase RAM disk's size Its size was ~3.8GB before, which sometimes was not enough. OpenBSD CI task often were failing due to no space left on device. Increase the RAM disk size to ~4.6 GB. Author: Nazir Bilal Yavuz Discussion: https://postgr.es/m/CAN55FZ2XVVPJRJmGB2DsL3gOrOinWh=H

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: Provide more-specific error details/hints for function lookup fa

2025-09-17 Thread Tom Lane
Provide more-specific error details/hints for function lookup failures. Up to now we've contented ourselves with a one-size-fits-all error hint when we fail to find any match to a function or procedure call. That was mostly okay in the beginning, but it was never great, and since the introduction

pgsql: pgbench: Remove unused argument from create_sql_command().

2025-09-17 Thread Fujii Masao
pgbench: Remove unused argument from create_sql_command(). Author: Yugo Nagata Reviewed-by: Steven Niu Discussion: https://postgr.es/m/20250917112814.096f660ea4c3c64630475...@sraoss.co.jp Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2e66cae935c2e0f7ce9bab6b65d

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: pg_restore: Fix security label handling with --no-publications/s

2025-09-17 Thread Fujii Masao
pg_restore: Fix security label handling with --no-publications/subscriptions. Previously, pg_restore did not skip security labels on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue SECURITY LABEL commands for objects that w

pgsql: Mark shared buffer lookup table HASH_FIXED_SIZE

2025-09-17 Thread Andres Freund
Mark shared buffer lookup table HASH_FIXED_SIZE StrategyInitialize() calls InitBufTable() with maximum number of entries that the buffer lookup table can ever have. Thus there should not be any need to allocate more element after initialization. Hence mark the hash table as fixed sized. Author: A

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-17 Thread Michael Paquier
On Wed, Sep 17, 2025 at 09:34:24AM -0500, Nathan Bossart wrote: > Yeah, this stuff is rather precarious, and I'm a bit surprised there > haven't been more problems in this area. LWLock handling is quite special, but I am also getting suspicious about some more shmem areas. Perhaps these deserve a

pgsql: Add test for temporal referential integrity

2025-09-17 Thread Álvaro Herrera
Add test for temporal referential integrity This commit adds an isolation test showing that temporal foreign keys do not permit referential integrity violations under concurrency, like fk-snapshot-2. You can show that the test fails by passing false for detectNewRows to ri_PerformCheck in ri_rest

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: Calculate agglevelsup correctly when Aggref contains a CTE.

2025-09-17 Thread Tom Lane
Calculate agglevelsup correctly when Aggref contains a CTE. If an aggregate function call contains a sub-select that has an RTE referencing a CTE outside the aggregate, we must treat that reference like a Var referencing the CTE's query level for purposes of determining the aggregate's level. Oth

pgsql: pg_dump: Fix dumping of security labels on subscriptions and eve

2025-09-17 Thread Fujii Masao
pg_dump: Fix dumping of security labels on subscriptions and event triggers. Previously, pg_dump incorrectly queried pg_seclabel to retrieve security labels for subscriptions, which are stored in pg_shseclabel as they are global objects. This could result in security labels for subscriptions not b

pgsql: Change fmgr.h typedefs to use original names

2025-09-17 Thread Peter Eisentraut
Change fmgr.h typedefs to use original names fmgr.h defined some types such as fmNodePtr which is just Node *, but it made its own types to avoid having to include various header files. With C11, we can now instead typedef the original names without fear of conflicts. Reviewed-by: Tom Lane Revie

pgsql: Generate GB18030 mappings from the Unicode Consortium's UCM file

2025-09-17 Thread John Naylor
Generate GB18030 mappings from the Unicode Consortium's UCM file Previously we built the .map files for GB18030 (version 2000) from an XML file. The 2022 version for this encoding is only available as a Unicode Character Mapping (UCM) file, so as preparatory refactoring switch to this format as th

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-17 Thread Nathan Bossart
On Wed, Sep 17, 2025 at 01:47:19PM +0900, Michael Paquier wrote: > Perhaps LocalNamedLWLockTrancheRequestArray should be initialized to > NULL when declared, and I'd rather document the reasons behind what > this patch is doing in LWLockShmemSize() and when the state is > initialized in CreateLWLoc

pgsql: Fix CREATE TABLE LIKE with not-valid check constraint

2025-09-17 Thread Peter Eisentraut
Fix CREATE TABLE LIKE with not-valid check constraint In CREATE TABLE ... LIKE, any check constraints copied from the source table should be set to valid if they are ENFORCED (the default). Bug introduced in commit ca87c415e2f. Author: jian he Discussion: https://www.postgresql.org/message-id/