pgsql: Fix intermittent BF failures in 035_conflicts.

2025-09-15 Thread Amit Kapila
Fix intermittent BF failures in 035_conflicts. This commit addresses two sources of instability in the 035_conflicts test: Unstable VACUUM usage: The test previously relied on VACUUM to remove a deleted column, which can be unreliable due to concurrent background writer or checkpoint activity tha

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: Fix incorrect const qualifier

2025-09-15 Thread Peter Eisentraut
Fix incorrect const qualifier Commit 7202d72787d added in passing some const qualifiers, but the one on the postmaster_child_launch() startup_data argument was incorrect, because the function itself modifies the pointed-to data. This is hidden from the compiler because of casts. The qualifiers o

pgsql: Fix incorrect const qualifier

2025-09-15 Thread Peter Eisentraut
Fix incorrect const qualifier Commit 7202d72787d added in passing some const qualifiers, but the one on the postmaster_child_launch() startup_data argument was incorrect, because the function itself modifies the pointed-to data. This is hidden from the compiler because of casts. The qualifiers o

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: pg_restore: Fix comment handling with --no-policies.

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-policies. Previously, pg_restore did not skip comments on policies even when --no-policies was specified. As a result, it could issue COMMENT commands for policies that were never created, causing those commands to fail. This commit fixes the issue by en

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: pg_restore: Fix comment handling with --no-publications / --no-s

2025-09-15 Thread Fujii Masao
pg_restore: Fix comment handling with --no-publications / --no-subscriptions. Previously, pg_restore did not skip comments on publications or subscriptions even when --no-publications or --no-subscriptions was specified. As a result, it could issue COMMENT commands for objects that were never crea

pgsql: Update various forward declarations to use typedef

2025-09-15 Thread Peter Eisentraut
Update various forward declarations to use typedef There are a number of forward declarations that use struct but not the customary typedef, because that could have led to repeat typedefs, which was not allowed. This is now allowed in C11, so we can update these to provide the typedefs as well, s

pgsql: Teach nbtree to avoid evaluating row compare keys.

2025-09-15 Thread Peter Geoghegan
Teach nbtree to avoid evaluating row compare keys. Add logic to _bt_set_startikey that determines whether row compare keys are guaranteed to be satisfied by every tuple on a page that is about to be read by _bt_readpage. This works in essentially the same way as the existing scalar inequality log

pgsql: Expand virtual generated columns in constraint expressions

2025-09-15 Thread Peter Eisentraut
Expand virtual generated columns in constraint expressions Virtual generated columns in constraint expressions need to be expanded because the optimizer matches these expressions to qual clauses. Failing to do so can cause us to miss opportunities for constraint exclusion. Author: Richard Guo D

pgsql: Improve ExplainState type handling in header files

2025-09-15 Thread Peter Eisentraut
Improve ExplainState type handling in header files Now that we can have repeat typedefs with C11, we don't need to use "struct ExplainState" anymore but can instead make a typedef where necessary. This doesn't change anything but makes it look nicer. (There are more opportunities for similar cha

pgsql: Expand virtual generated columns in constraint expressions

2025-09-15 Thread Peter Eisentraut
Expand virtual generated columns in constraint expressions Virtual generated columns in constraint expressions need to be expanded because the optimizer matches these expressions to qual clauses. Failing to do so can cause us to miss opportunities for constraint exclusion. Author: Richard Guo D

pgsql: CREATE STATISTICS: improve misleading error message

2025-09-15 Thread Peter Eisentraut
CREATE STATISTICS: improve misleading error message The previous change (commit f225473cbae) was still not on target, because it talked about relation kinds, which are not what is being checked here. Provide a more accurate message. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACJufx

pgsql: CREATE STATISTICS: improve misleading error message

2025-09-15 Thread Peter Eisentraut
CREATE STATISTICS: improve misleading error message The previous change (commit f225473cbae) was still not on target, because it talked about relation kinds, which are not what is being checked here. Provide a more accurate message. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACJufx

pgsql: CREATE STATISTICS: improve misleading error message

2025-09-15 Thread Peter Eisentraut
CREATE STATISTICS: improve misleading error message The previous change (commit f225473cbae) was still not on target, because it talked about relation kinds, which are not what is being checked here. Provide a more accurate message. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACJufx

pgsql: CREATE STATISTICS: improve misleading error message

2025-09-15 Thread Peter Eisentraut
CREATE STATISTICS: improve misleading error message The previous change (commit f225473cbae) was still not on target, because it talked about relation kinds, which are not what is being checked here. Provide a more accurate message. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACJufx

pgsql: CREATE STATISTICS: improve misleading error message

2025-09-15 Thread Peter Eisentraut
CREATE STATISTICS: improve misleading error message The previous change (commit f225473cbae) was still not on target, because it talked about relation kinds, which are not what is being checked here. Provide a more accurate message. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACJufx

pgsql: Remove hbaPort type

2025-09-15 Thread Peter Eisentraut
Remove hbaPort type This was just a workaround to avoid including the header file that defines the Port type. With C11, we can now just re-define the Port type without the possibility of a conflict. Reviewed-by: Tom Lane Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/f

pgsql: Remove workarounds against repeat typedefs

2025-09-15 Thread Peter Eisentraut
Remove workarounds against repeat typedefs This is allowed in C11, so we don't need the workarounds anymore. Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/10d32190-f31b-40a5-b177-11db55597...@eisentraut.org Branch -- master Details --- https://git.postgre

pgsql: Resume conflict-relevant data retention automatically.

2025-09-15 Thread Amit Kapila
Resume conflict-relevant data retention automatically. This commit resumes automatic retention of conflict-relevant data for a subscription. Previously, retention would stop if the apply process failed to advance its xmin (oldest_nonremovable_xid) within the configured max_retention_duration and u