pgsql: Sync PG_VERSION file in CREATE DATABASE.

2024-02-01 Thread Noah Misch
Sync PG_VERSION file in CREATE DATABASE. An OS crash could leave PG_VERSION empty or missing. The same symptom appeared in a backup by block device snapshot, taken after the next checkpoint and before the OS flushes the PG_VERSION blocks. Device snapshots are not a documented backup method, howe

pgsql: Handle interleavings between CREATE DATABASE steps and base back

2024-02-01 Thread Noah Misch
Handle interleavings between CREATE DATABASE steps and base backup. Restoring a base backup taken in the middle of CreateDirAndVersionFile() or write_relmap_file() would lose the function's effects. The symptom was absence of the database directory, PG_VERSION file, or pg_filenode.map. If missin

pgsql: Sync PG_VERSION file in CREATE DATABASE.

2024-02-01 Thread Noah Misch
Sync PG_VERSION file in CREATE DATABASE. An OS crash could leave PG_VERSION empty or missing. The same symptom appeared in a backup by block device snapshot, taken after the next checkpoint and before the OS flushes the PG_VERSION blocks. Device snapshots are not a documented backup method, howe

pgsql: Handle interleavings between CREATE DATABASE steps and base back

2024-02-01 Thread Noah Misch
Handle interleavings between CREATE DATABASE steps and base backup. Restoring a base backup taken in the middle of CreateDirAndVersionFile() or write_relmap_file() would lose the function's effects. The symptom was absence of the database directory, PG_VERSION file, or pg_filenode.map. If missin

pgsql: Sync PG_VERSION file in CREATE DATABASE.

2024-02-01 Thread Noah Misch
Sync PG_VERSION file in CREATE DATABASE. An OS crash could leave PG_VERSION empty or missing. The same symptom appeared in a backup by block device snapshot, taken after the next checkpoint and before the OS flushes the PG_VERSION blocks. Device snapshots are not a documented backup method, howe

pgsql: Handle interleavings between CREATE DATABASE steps and base back

2024-02-01 Thread Noah Misch
Handle interleavings between CREATE DATABASE steps and base backup. Restoring a base backup taken in the middle of CreateDirAndVersionFile() or write_relmap_file() would lose the function's effects. The symptom was absence of the database directory, PG_VERSION file, or pg_filenode.map. If missin

pgsql: Update time zone data files to tzdata release 2024a.

2024-02-01 Thread Tom Lane
Update time zone data files to tzdata release 2024a. DST law changes in Ittoqqortoormiit, Greenland (America/Scoresbysund), Kazakhstan (Asia/Almaty and Asia/Qostanay) and Palestine; as well as updates for the Antarctic stations Casey and Vostok. Historical corrections for Vietnam, Toronto, and Mi

pgsql: Update time zone data files to tzdata release 2024a.

2024-02-01 Thread Tom Lane
Update time zone data files to tzdata release 2024a. DST law changes in Ittoqqortoormiit, Greenland (America/Scoresbysund), Kazakhstan (Asia/Almaty and Asia/Qostanay) and Palestine; as well as updates for the Antarctic stations Casey and Vostok. Historical corrections for Vietnam, Toronto, and Mi

pgsql: Update time zone data files to tzdata release 2024a.

2024-02-01 Thread Tom Lane
Update time zone data files to tzdata release 2024a. DST law changes in Ittoqqortoormiit, Greenland (America/Scoresbysund), Kazakhstan (Asia/Almaty and Asia/Qostanay) and Palestine; as well as updates for the Antarctic stations Casey and Vostok. Historical corrections for Vietnam, Toronto, and Mi

pgsql: Update time zone data files to tzdata release 2024a.

2024-02-01 Thread Tom Lane
Update time zone data files to tzdata release 2024a. DST law changes in Ittoqqortoormiit, Greenland (America/Scoresbysund), Kazakhstan (Asia/Almaty and Asia/Qostanay) and Palestine; as well as updates for the Antarctic stations Casey and Vostok. Historical corrections for Vietnam, Toronto, and Mi

pgsql: Update time zone data files to tzdata release 2024a.

2024-02-01 Thread Tom Lane
Update time zone data files to tzdata release 2024a. DST law changes in Ittoqqortoormiit, Greenland (America/Scoresbysund), Kazakhstan (Asia/Almaty and Asia/Qostanay) and Palestine; as well as updates for the Antarctic stations Casey and Vostok. Historical corrections for Vietnam, Toronto, and Mi

pgsql: Update time zone data files to tzdata release 2024a.

2024-02-01 Thread Tom Lane
Update time zone data files to tzdata release 2024a. DST law changes in Ittoqqortoormiit, Greenland (America/Scoresbysund), Kazakhstan (Asia/Almaty and Asia/Qostanay) and Palestine; as well as updates for the Antarctic stations Casey and Vostok. Historical corrections for Vietnam, Toronto, and Mi

pgsql: Avoid package qualification of $windows_os

2024-02-01 Thread Andrew Dunstan
Avoid package qualification of $windows_os Further fallout from commit 6ee26c6a4b. To keep code in sync and avoid issues on older releases with different package names, simply use the unqualified name like many other places in our code. Branch -- REL_16_STABLE Details --- https://git.pos

pgsql: Avoid package qualification of $windows_os

2024-02-01 Thread Andrew Dunstan
Avoid package qualification of $windows_os Further fallout from commit 6ee26c6a4b. To keep code in sync and avoid issues on older releases with different package names, simply use the unqualified name like many other places in our code. Branch -- REL_15_STABLE Details --- https://git.pos

pgsql: Avoid package qualification of $windows_os

2024-02-01 Thread Andrew Dunstan
Avoid package qualification of $windows_os Further fallout from commit 6ee26c6a4b. To keep code in sync and avoid issues on older releases with different package names, simply use the unqualified name like many other places in our code. Branch -- REL_14_STABLE Details --- https://git.pos

pgsql: Avoid package qualification of $windows_os

2024-02-01 Thread Andrew Dunstan
Avoid package qualification of $windows_os Further fallout from commit 6ee26c6a4b. To keep code in sync and avoid issues on older releases with different package names, simply use the unqualified name like many other places in our code. Branch -- REL_13_STABLE Details --- https://git.pos

pgsql: Avoid package qualification of $windows_os

2024-02-01 Thread Andrew Dunstan
Avoid package qualification of $windows_os Further fallout from commit 6ee26c6a4b. To keep code in sync and avoid issues on older releases with different package names, simply use the unqualified name like many other places in our code. Branch -- master Details --- https://git.postgresql

pgsql: Avoid package qualification of $windows_os

2024-02-01 Thread Andrew Dunstan
Avoid package qualification of $windows_os Further fallout from commit 6ee26c6a4b. To keep code in sync and avoid issues on older releases with different package names, simply use the unqualified name like many other places in our code. Branch -- REL_12_STABLE Details --- https://git.pos

pgsql: Apply band-aid fix for an oversight in reparameterize_path_by_ch

2024-02-01 Thread Tom Lane
Apply band-aid fix for an oversight in reparameterize_path_by_child. The path we wish to reparameterize is not a standalone object: in particular, it implicitly references baserestrictinfo clauses in the associated RelOptInfo, and if it's a SampleScan path then there is also the TableSampleClause

pgsql: Apply band-aid fix for an oversight in reparameterize_path_by_ch

2024-02-01 Thread Tom Lane
Apply band-aid fix for an oversight in reparameterize_path_by_child. The path we wish to reparameterize is not a standalone object: in particular, it implicitly references baserestrictinfo clauses in the associated RelOptInfo, and if it's a SampleScan path then there is also the TableSampleClause

pgsql: Apply band-aid fix for an oversight in reparameterize_path_by_ch

2024-02-01 Thread Tom Lane
Apply band-aid fix for an oversight in reparameterize_path_by_child. The path we wish to reparameterize is not a standalone object: in particular, it implicitly references baserestrictinfo clauses in the associated RelOptInfo, and if it's a SampleScan path then there is also the TableSampleClause

pgsql: Apply band-aid fix for an oversight in reparameterize_path_by_ch

2024-02-01 Thread Tom Lane
Apply band-aid fix for an oversight in reparameterize_path_by_child. The path we wish to reparameterize is not a standalone object: in particular, it implicitly references baserestrictinfo clauses in the associated RelOptInfo, and if it's a SampleScan path then there is also the TableSampleClause

pgsql: Apply band-aid fix for an oversight in reparameterize_path_by_ch

2024-02-01 Thread Tom Lane
Apply band-aid fix for an oversight in reparameterize_path_by_child. The path we wish to reparameterize is not a standalone object: in particular, it implicitly references baserestrictinfo clauses in the associated RelOptInfo, and if it's a SampleScan path then there is also the TableSampleClause

pgsql: Continue my quest to make 002_blocks.pl pass reliably.

2024-02-01 Thread Robert Haas
Continue my quest to make 002_blocks.pl pass reliably. The latest buildfarm failures show that after the insert, we don't actually wait long enough for WAL summarization to catch up, apparently because the on disk state gets updated before the in-memory state, and so by checking the on disk state

pgsql: doc: improve role option documentation

2024-02-01 Thread Bruce Momjian
doc: improve role option documentation Role option management was changed in Postgres 16. This patch improves the docs around these changes, including CREATE ROLE's INHERIT option, inheritance handling, and grant's ability to change role options. Discussion: https://postgr.es/m/zab9giv63eend...

pgsql: doc: improve role option documentation

2024-02-01 Thread Bruce Momjian
doc: improve role option documentation Role option management was changed in Postgres 16. This patch improves the docs around these changes, including CREATE ROLE's INHERIT option, inheritance handling, and grant's ability to change role options. Discussion: https://postgr.es/m/zab9giv63eend...

pgsql: doc: remove incorrect grammar for ALTER EVENT TRIGGER

2024-02-01 Thread Daniel Gustafsson
doc: remove incorrect grammar for ALTER EVENT TRIGGER The Parameters subsection had an extra TRIGGER in the grammar for DISABLE/ENABLE which is incorrect. Backpatch down to all supported versions since it's been like this all along. Discussion: https://postgr.es/m/0afb171e-7e78-4a90-a140-46ab270

pgsql: doc: remove incorrect grammar for ALTER EVENT TRIGGER

2024-02-01 Thread Daniel Gustafsson
doc: remove incorrect grammar for ALTER EVENT TRIGGER The Parameters subsection had an extra TRIGGER in the grammar for DISABLE/ENABLE which is incorrect. Backpatch down to all supported versions since it's been like this all along. Discussion: https://postgr.es/m/0afb171e-7e78-4a90-a140-46ab270

pgsql: doc: remove incorrect grammar for ALTER EVENT TRIGGER

2024-02-01 Thread Daniel Gustafsson
doc: remove incorrect grammar for ALTER EVENT TRIGGER The Parameters subsection had an extra TRIGGER in the grammar for DISABLE/ENABLE which is incorrect. Backpatch down to all supported versions since it's been like this all along. Discussion: https://postgr.es/m/0afb171e-7e78-4a90-a140-46ab270

pgsql: doc: remove incorrect grammar for ALTER EVENT TRIGGER

2024-02-01 Thread Daniel Gustafsson
doc: remove incorrect grammar for ALTER EVENT TRIGGER The Parameters subsection had an extra TRIGGER in the grammar for DISABLE/ENABLE which is incorrect. Backpatch down to all supported versions since it's been like this all along. Discussion: https://postgr.es/m/0afb171e-7e78-4a90-a140-46ab270

pgsql: doc: remove incorrect grammar for ALTER EVENT TRIGGER

2024-02-01 Thread Daniel Gustafsson
doc: remove incorrect grammar for ALTER EVENT TRIGGER The Parameters subsection had an extra TRIGGER in the grammar for DISABLE/ENABLE which is incorrect. Backpatch down to all supported versions since it's been like this all along. Discussion: https://postgr.es/m/0afb171e-7e78-4a90-a140-46ab270

pgsql: doc: remove incorrect grammar for ALTER EVENT TRIGGER

2024-02-01 Thread Daniel Gustafsson
doc: remove incorrect grammar for ALTER EVENT TRIGGER The Parameters subsection had an extra TRIGGER in the grammar for DISABLE/ENABLE which is incorrect. Backpatch down to all supported versions since it's been like this all along. Discussion: https://postgr.es/m/0afb171e-7e78-4a90-a140-46ab270

pgsql: doc: Fix incorrect openssl option

2024-02-01 Thread Daniel Gustafsson
doc: Fix incorrect openssl option The openssl command for displaying the DN of a client certificate was using --subject and not the single-dash option -subject. While recent versions of openssl handles double dash options, earlier does not so fix by using just -subject (which is per the openssl

pgsql: doc: Fix incorrect openssl option

2024-02-01 Thread Daniel Gustafsson
doc: Fix incorrect openssl option The openssl command for displaying the DN of a client certificate was using --subject and not the single-dash option -subject. While recent versions of openssl handles double dash options, earlier does not so fix by using just -subject (which is per the openssl

pgsql: doc: Fix incorrect openssl option

2024-02-01 Thread Daniel Gustafsson
doc: Fix incorrect openssl option The openssl command for displaying the DN of a client certificate was using --subject and not the single-dash option -subject. While recent versions of openssl handles double dash options, earlier does not so fix by using just -subject (which is per the openssl

pgsql: doc: Fix incorrect openssl option

2024-02-01 Thread Daniel Gustafsson
doc: Fix incorrect openssl option The openssl command for displaying the DN of a client certificate was using --subject and not the single-dash option -subject. While recent versions of openssl handles double dash options, earlier does not so fix by using just -subject (which is per the openssl

pgsql: Fix stats_fetch_consistency with stats for fixed-numbered object

2024-02-01 Thread Michael Paquier
Fix stats_fetch_consistency with stats for fixed-numbered objects This impacts the statistics retrieved in transactions for the following views when updating the value of stats_fetch_consistency, leading to behaviors contrary to what is documented since 605994651b6a as an update of this parameter

pgsql: Fix stats_fetch_consistency with stats for fixed-numbered object

2024-02-01 Thread Michael Paquier
Fix stats_fetch_consistency with stats for fixed-numbered objects This impacts the statistics retrieved in transactions for the following views when updating the value of stats_fetch_consistency, leading to behaviors contrary to what is documented since 605994651b6a as an update of this parameter

pgsql: Fix stats_fetch_consistency with stats for fixed-numbered object

2024-02-01 Thread Michael Paquier
Fix stats_fetch_consistency with stats for fixed-numbered objects This impacts the statistics retrieved in transactions for the following views when updating the value of stats_fetch_consistency, leading to behaviors contrary to what is documented since 605994651b6a as an update of this parameter