pgsql: Flush logical slots to disk during a shutdown checkpoint if requ

2023-09-13 Thread Amit Kapila
Flush logical slots to disk during a shutdown checkpoint if required. It's entirely possible for a logical slot to have a confirmed_flush LSN higher than the last value saved on disk while not being marked as dirty. Currently, it is not a major problem but a later patch adding support for the upgr

pgsql: Remove redundant result assignment in 004_sync.pl.

2023-09-13 Thread Amit Kapila
Remove redundant result assignment in 004_sync.pl. Author: Peter Smith Discussion: http://postgr.es/m/cahut+putndxnpn24s6jfpde+fkjoe3m-conv-dfszmjn-ed...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a2e0d5e5f6a05f436f7b73c7f12ffcc22611d23d Modifi

pgsql: Fix tracking of temp table relation extensions as writes

2023-09-13 Thread Andres Freund
Fix tracking of temp table relation extensions as writes Karina figured out that I (Andres) confused BufferUsage.temp_blks_written with BufferUsage.local_blks_written in fcdda1e4b5. Tests in core PG can't easily test this, as BufferUsage is just used for EXPLAIN (ANALYZE, BUFFERS) and pg_stat_sta

pgsql: Fix tracking of temp table relation extensions as writes

2023-09-13 Thread Andres Freund
Fix tracking of temp table relation extensions as writes Karina figured out that I (Andres) confused BufferUsage.temp_blks_written with BufferUsage.local_blks_written in fcdda1e4b5. Tests in core PG can't easily test this, as BufferUsage is just used for EXPLAIN (ANALYZE, BUFFERS) and pg_stat_sta

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Improve error message on snapshot import in snapmgr.c

2023-09-13 Thread Michael Paquier
Improve error message on snapshot import in snapmgr.c When a snapshot file fails to be read in ImportSnapshot(), it would issue an ERROR as "invalid snapshot identifier" when opening a stream for it in read-only mode. This error message is reworded to be the same as all the other messages used in

pgsql: Refactor error messages for unsupported providers in pg_locale.c

2023-09-13 Thread Michael Paquier
Refactor error messages for unsupported providers in pg_locale.c These code paths should not be reached normally, but if they are an error with "(null)" as information for the collation provider would show up if no locale is set, while we can assume that we are referring to libc. This refactors t

pgsql: Refactor error messages for unsupported providers in pg_locale.c

2023-09-13 Thread Michael Paquier
Refactor error messages for unsupported providers in pg_locale.c These code paths should not be reached normally, but if they are an error with "(null)" as information for the collation provider would show up if no locale is set, while we can assume that we are referring to libc. This refactors t

pgsql: Fix incorrect logic in plan dependency recording

2023-09-13 Thread David Rowley
Fix incorrect logic in plan dependency recording Both 50e17ad28 and 29f45e299 mistakenly tried to record a plan dependency on a function but mistakenly inverted the OidIsValid test. This meant that we'd record a dependency only when the function's Oid was InvalidOid. Clearly this was meant to *n

pgsql: Fix incorrect logic in plan dependency recording

2023-09-13 Thread David Rowley
Fix incorrect logic in plan dependency recording Both 50e17ad28 and 29f45e299 mistakenly tried to record a plan dependency on a function but mistakenly inverted the OidIsValid test. This meant that we'd record a dependency only when the function's Oid was InvalidOid. Clearly this was meant to *n

pgsql: Fix incorrect logic in plan dependency recording

2023-09-13 Thread David Rowley
Fix incorrect logic in plan dependency recording Both 50e17ad28 and 29f45e299 mistakenly tried to record a plan dependency on a function but mistakenly inverted the OidIsValid test. This meant that we'd record a dependency only when the function's Oid was InvalidOid. Clearly this was meant to *n

pgsql: Fix incorrect logic in plan dependency recording

2023-09-13 Thread David Rowley
Fix incorrect logic in plan dependency recording Both 50e17ad28 and 29f45e299 mistakenly tried to record a plan dependency on a function but mistakenly inverted the OidIsValid test. This meant that we'd record a dependency only when the function's Oid was InvalidOid. Clearly this was meant to *n