pgsql: Handle NULL fields in WRITE_INDEX_ARRAY

2022-04-27 Thread Peter Eisentraut
Handle NULL fields in WRITE_INDEX_ARRAY Unlike existing WRITE_*_ARRAY macros, WRITE_INDEX_ARRAY needs to handle the case that the field is NULL. We already have the convention to print NULL fields as "<>", so we do that here as well. There is currently no corresponding read function for this, so

pgsql: Fix incorrect format placeholders

2022-04-27 Thread Peter Eisentraut
Fix incorrect format placeholders Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/755df30e48b0a9ff8428f4c1ccb468dac29fc320 Modified Files -- src/backend/executor/execExprInterp.c| 2 +- src/backend/utils/activity/pgstat_xact.c | 2 +- 2 files changed,

pgsql: Replace existing durable_rename_excl() calls with durable_rename

2022-04-27 Thread Michael Paquier
Replace existing durable_rename_excl() calls with durable_rename() durable_rename_excl() attempts to avoid overwriting any existing files by using link() and unlink(), falling back to rename() on some platforms (e.g., Windows where link() followed by unlink() is not concurrent-safe, see 909b449).

pgsql: Remove durable_rename_excl()

2022-04-27 Thread Michael Paquier
Remove durable_rename_excl() ccfbd92 has replaced all existing in-core callers of this function in favor of durable_rename(). durable_rename_excl() is by nature unsafe on crashes happening at the wrong time, so just remove it. Author: Nathan Bossart Reviewed-by: Robert Haas, Kyotaro Horiguchi, M

pgsql: Fix SQL syntax in comment in logical/worker.c

2022-04-27 Thread John Naylor
Fix SQL syntax in comment in logical/worker.c Euler Taveira Disussion: https://www.postgresql.org/message-id/25f95189-eef8-43c4-9d7b-419b651963c8%40www.fastmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e84f82ab5cff2811745ae8e2ac163a4b8b733394 Modified

Re: pgsql: Replace existing durable_rename_excl() calls with durable_rename

2022-04-27 Thread Tom Lane
Michael Paquier writes: > This change replaces all calls to durable_rename_excl() with > durable_rename(). This removes the protection against accidentally > overwriting an existing file, but some platforms are already living > without it, and all those code paths never expect an existing file (a

Re: pgsql: Replace existing durable_rename_excl() calls with durable_rename

2022-04-27 Thread Michael Paquier
On Wed, Apr 27, 2022 at 11:28:18PM -0400, Tom Lane wrote: > Assert'ing that an external (filesystem) condition holds seems like a bad > idea. See buildfarm. Yes, I saw the failures: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=kestrel&dt=2022-04-28%2002%3A13%3A27 https://buildfarm.post

pgsql: Revert recent changes with durable_rename_excl()

2022-04-27 Thread Michael Paquier
Revert recent changes with durable_rename_excl() This reverts commits 2c902bb and ccfbd92. Per buildfarm members kestrel, rorqual and calliphoridae, the assertions checking that a TLI history file should not exist when created by a WAL receiver have been failing, and switching to durable_rename()

pgsql: Disable asynchronous execution if using gating Result nodes.

2022-04-27 Thread Etsuro Fujita
Disable asynchronous execution if using gating Result nodes. mark_async_capable_plan(), which is called from create_append_plan() to determine whether subplans are async-capable, failed to take into account that the given subplan created from a given subpath might include a gating Result node if t

pgsql: Disable asynchronous execution if using gating Result nodes.

2022-04-27 Thread Etsuro Fujita
Disable asynchronous execution if using gating Result nodes. mark_async_capable_plan(), which is called from create_append_plan() to determine whether subplans are async-capable, failed to take into account that the given subplan created from a given subpath might include a gating Result node if t