pgsql: Simplify replacement code for strtof.

2022-08-06 Thread Thomas Munro
Simplify replacement code for strtof. strtof() is in C99 and all targeted systems have it. We can remove the configure probe and some dead code, but we still need replacement code for a couple of systems that have known buggy implementations selected via platform template. Reviewed-by: Tom Lane

pgsql: Simplify gettimeofday for Windows.

2022-08-06 Thread Thomas Munro
Simplify gettimeofday for Windows. Previously we bothered to forward-declare struct timezone, following man pages on typical systems, but POSIX actually says the argument (which we ignore anyway) is void *. Drop a line. While here, add an assertion that nobody actually uses the tzp argument. Pr

Re: pgsql: BRIN: mask BRIN_EVACUATE_PAGE for WAL consistency checking

2022-08-06 Thread Álvaro Herrera
On Sat, Aug 6, 2022, at 9:01 PM, Tom Lane wrote: > snapper doesn't like this too much, because > > error running SQL: 'psql::17: ERROR: time zone "america/punta_arenas" > not recognized > CONTEXT: PL/pgSQL function inline_code_block line 3 during statement block > local variable initialization

Re: pgsql: BRIN: mask BRIN_EVACUATE_PAGE for WAL consistency checking

2022-08-06 Thread Tom Lane
Alvaro Herrera writes: > BRIN: mask BRIN_EVACUATE_PAGE for WAL consistency checking snapper doesn't like this too much, because error running SQL: 'psql::17: ERROR: time zone "america/punta_arenas" not recognized CONTEXT: PL/pgSQL function inline_code_block line 3 during statement block loca

pgsql: Fix function-defined-but-not-used warning.

2022-08-06 Thread Tom Lane
Fix function-defined-but-not-used warning. Buildfarm member jacana (MinGW) has been complaining that get_iso_localename is defined but not used. This is evidently fallout from the recent removal of VS2013 support in pg_locale.c. Rearrange the #ifs so that get_iso_localename and its subroutine sea

pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE.

2022-08-06 Thread Tom Lane
Fix data-corruption hazard in WAL-logged CREATE DATABASE. RelationCopyStorageUsingBuffer thought it could skip copying empty pages, but of course that does not work at all, because subsequent blocks will be out of place. Also fix it to acquire share lock on the source buffer. It *might* be safe

pgsql: Fix data-corruption hazard in WAL-logged CREATE DATABASE.

2022-08-06 Thread Tom Lane
Fix data-corruption hazard in WAL-logged CREATE DATABASE. RelationCopyStorageUsingBuffer thought it could skip copying empty pages, but of course that does not work at all, because subsequent blocks will be out of place. Also fix it to acquire share lock on the source buffer. It *might* be safe

pgsql: Simplify gettimeofday() fallback logic.

2022-08-06 Thread Andres Freund
Simplify gettimeofday() fallback logic. There's no known supported system needing 1 argument gettimeofday() support. The test for it was added a long time ago (92c6bf9775b). Remove. Until now we tested whether a gettimeofday() fallback is needed when targetting windows. Which lead to the odd resu

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Improve recently-added test reliability

2022-08-06 Thread Alvaro Herrera
Improve recently-added test reliability Commit 59be1c942a47 already tried to make src/test/recovery/t/033_replay_tsp_drops more reliable, but it wasn't enough. Try to improve on that by making this use of a replication slot to be more like others. Also, don't drop the slot. Make a few other sty

pgsql: Fix comment in copyfrom_internal.h

2022-08-06 Thread Michael Paquier
Fix comment in copyfrom_internal.h COPY_NEW_FE has become COPY_FRONTEND in 3174d69, that has removed the frontend-backend protocol v2. Author: Zhang Mingli Discussion: https://postgr.es/m/aeec12a3-501e-449a-8d25-901c4ff706cf@Spark Branch -- master Details --- https://git.postgresql.org/