Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Andres Freund
Hi, On 2021-08-06 21:49:52 -0700, Andres Freund wrote: > The temp file is created by InitializeBackupManifest(). In the !OSX case, we > first abort via an ERROR, which triggers the cleanup via > WalSndResourceCleanup(). On OSX however, we immediately error out with FATAL > for some reason (timing?

Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Andres Freund
Hi, On 2021-08-06 23:22:36 -0400, Tom Lane wrote: > I wrote: > > Guessing the common factor is "macOS", but that's just a guess. > > I can poke into it tomorrow. > > I did try it real quick on my Mac laptop, and that fails too. > Here's a more accurate backtrace, in case that helps. Thanks! I no

Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Tom Lane
I wrote: > Guessing the common factor is "macOS", but that's just a guess. > I can poke into it tomorrow. I did try it real quick on my Mac laptop, and that fails too. Here's a more accurate backtrace, in case that helps. (lldb) bt * thread #1, stop reason = signal SIGSTOP * frame #0: 0x7ff

Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Andres Freund
Hi, On 2021-08-06 23:13:28 -0400, Tom Lane wrote: > Andres Freund writes: > > Not sure why it's your two animals that report this issue, but not others? > > Why > > would a backend doing SendBaseBackup() previously have allocated temp files? > > Guessing the common factor is "macOS", but that's

Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Tom Lane
Andres Freund writes: > Not sure why it's your two animals that report this issue, but not others? Why > would a backend doing SendBaseBackup() previously have allocated temp files? Guessing the common factor is "macOS", but that's just a guess. I can poke into it tomorrow.

Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Andres Freund
Hi, On 2021-08-06 22:44:07 -0400, Tom Lane wrote: > Andres Freund writes: > > pgstat: Bring up pgstat in BaseInit() to fix uninitialized use of pgstat by > > AV. > > sifaka took exception to this, or at least I guess it was this one out > of the four you pushed at once: Longfin as well. It's t

Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Tom Lane
Andres Freund writes: > pgstat: Bring up pgstat in BaseInit() to fix uninitialized use of pgstat by > AV. sifaka took exception to this, or at least I guess it was this one out of the four you pushed at once: TRAP: FailedAssertion("pgstat_is_initialized && !pgstat_is_shutdown", File: "pgstat.c

pgsql: Schedule ShutdownXLOG() in single user mode using before_shmem_e

2021-08-06 Thread Andres Freund
Schedule ShutdownXLOG() in single user mode using before_shmem_exit(). Previously on_shmem_exit() was used. The upcoming shared memory stats patch uses DSM segments to store stats, which can not be used after the dsm_backend_shutdown() call in shmem_exit(). There does not seem to be any reason to

pgsql: Make parallel worker shutdown complete entirely via before_shmem

2021-08-06 Thread Andres Freund
Make parallel worker shutdown complete entirely via before_shmem_exit(). This is a step toward storing stats in dynamic shared memory. As dynamic shared memory segments are detached from just after before_shmem_exit() callbacks are processed, but before on_shmem_exit() callbacks are, no stats can

pgsql: pgstat: Schedule per-backend pgstat shutdown via before_shmem_ex

2021-08-06 Thread Andres Freund
pgstat: Schedule per-backend pgstat shutdown via before_shmem_exit(). Previously on_shmem_exit() was used. The upcoming shared memory stats patch uses DSM segments to store stats, which can not be used after the dsm_backend_shutdown() call in shmem_exit(). The preceding commits were required to p

pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

2021-08-06 Thread Andres Freund
pgstat: Bring up pgstat in BaseInit() to fix uninitialized use of pgstat by AV. Previously pgstat_initialize() was called in InitPostgres() and AuxiliaryProcessMain(). As it turns out there was at least one case where we reported stats before pgstat_initialize() was called, see AutoVacWorkerMain()

pgsql: Don't elide casting to typmod -1.

2021-08-06 Thread Tom Lane
Don't elide casting to typmod -1. Casting a value that's already of a type with a specific typmod to an unspecified typmod doesn't do anything so far as run-time behavior is concerned. However, it really ought to change the exposed type of the expression to match. Up to now, coerce_type_typmod h

pgsql: Don't elide casting to typmod -1.

2021-08-06 Thread Tom Lane
Don't elide casting to typmod -1. Casting a value that's already of a type with a specific typmod to an unspecified typmod doesn't do anything so far as run-time behavior is concerned. However, it really ought to change the exposed type of the expression to match. Up to now, coerce_type_typmod h

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Adjust the integer overflow tests in the numeric code.

2021-08-06 Thread Dean Rasheed
Adjust the integer overflow tests in the numeric code. Formerly, the numeric code tested whether an integer value of a larger type would fit in a smaller type by casting it to the smaller type and then testing if the reverse conversion produced the original value. That's perfectly fine, except tha

pgsql: Add missing message punctuation

2021-08-06 Thread Peter Eisentraut
Add missing message punctuation Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c3a135b41eed3c719a0c34b8cc072835ff21b129 Modified Files -- src/backend/catalog/pg_type.c | 2 +- src/test/regress/expected/multirangetypes.out | 4 ++--

pgsql: Add missing message punctuation

2021-08-06 Thread Peter Eisentraut
Add missing message punctuation Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ba4eb86ceff4eded5920d36ef82a2096db7ad0c0 Modified Files -- src/backend/catalog/pg_type.c | 2 +- src/test/regress/expected/multirangetypes.out | 4 ++-- 2 files

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d91078d7fdf060cfda332211c26444837c208981 Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/rangetypes_selfuncs.c | 2 +- src/backend/utils/adt/rang

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0afe231a0db6442eed6c9d3fe22745405597943a Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/rangetypes_selfuncs.c | 2 +- src/backend/utils/adt/rang

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/cc788c55bbb031d6168daf71f208e7a73f41e48a Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/rangetypes_selfuncs.c | 2 +- src/backend/utils/adt/rang

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d3ad6566a130988af7693267bc8605b86772618c Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/rangetypes_selfuncs.c | 2 +- src/backend/utils/adt/rang

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/acd6b6e637fb670003d4ac2477212b4d51016f9a Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/multirangetypes_selfuncs.c | 2 +- src/backend/util

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/bf224e0a420397d9fdf8ead99a936fd44350f6bf Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/rangetypes_selfuncs.c | 2 +- src/backend/utils/adt/rang

pgsql: Fix wording

2021-08-06 Thread Peter Eisentraut
Fix wording Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/05e60aece33e84960ef566e4735b2d93c2d791c8 Modified Files -- doc/src/sgml/rules.sgml | 2 +- src/backend/utils/adt/multirangetypes_selfuncs.c | 2 +- src/backend/utils/adt/r

pgsql: First-draft release notes for 13.4.

2021-08-06 Thread Tom Lane
First-draft release notes for 13.4. As usual, the release notes for older branches will be made by cutting these down, but put them up for community review first. Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/2f38ec6a157b60291ece1deb072bfff84f317334 Modifi