pgsql: pkg-config Requires.private entries should be comma-separated

2023-03-16 Thread Peter Eisentraut
pkg-config Requires.private entries should be comma-separated In the .pc (pkg-config) files generated by the make and meson builds, the Requires.private entries use different delimiters. The make build uses spaces, the meson build uses commas. The pkg-config documentation says that it should be c

pgsql: Integrate superuser check into has_rolreplication()

2023-03-16 Thread Peter Eisentraut
Integrate superuser check into has_rolreplication() This makes it consistent with similar functions like has_createrole_privilege() and allows removing some explicit superuser checks. Author: Nathan Bossart Discussion: https://www.postgresql.org/message-id/2023031313.GA3992372%40nathanxps13

pgsql: Small code simplification

2023-03-16 Thread Peter Eisentraut
Small code simplification Author: Nathan Bossart Discussion: https://www.postgresql.org/message-id/2023031313.GA3992372%40nathanxps13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3b7cd8c690f294185c1ba074fb7efdf687829361 Modified Files -- src/ba

pgsql: Use "data directory" not "current directory" in error messages.

2023-03-16 Thread Tom Lane
Use "data directory" not "current directory" in error messages. The user receiving the message might not understand where the server's "current directory" is. "Data directory" seems clearer. (This would not be good for frontend code, but both of these messages are only issued in the backend.) Ky

pgsql: Silence pedantic compiler warning introduced in ce340e530d1

2023-03-16 Thread Andres Freund
Silence pedantic compiler warning introduced in ce340e530d1 .../src/common/file_utils.c: In function ‘pg_pwrite_zeros’: .../src/common/file_utils.c:543:9: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] 543 | const static PGAlignedBlock zbuffer = {{0}};

pgsql: Tighten error checks in datetime input, and remove bogus "ISO" f

2023-03-16 Thread Tom Lane
Tighten error checks in datetime input, and remove bogus "ISO" format. DecodeDateTime and DecodeTimeOnly had support for date input in the style "Y2023M03D16", which the comments claimed to be an "ISO" format. However, so far as I can find there is no such format in ISO 8601; they write units befo

pgsql: Doc: mention CREATE+ATTACH PARTITION with CREATE TABLE...PARTITI

2023-03-16 Thread Tom Lane
Doc: mention CREATE+ATTACH PARTITION with CREATE TABLE...PARTITION OF. Clarify that ATTACH/DETACH PARTITION can be used to perform partition maintenance with less locking than straight CREATE TABLE/DROP TABLE. This was already stated in some places, but not emphasized. Back-patch to v14 where DET

pgsql: Doc: mention CREATE+ATTACH PARTITION with CREATE TABLE...PARTITI

2023-03-16 Thread Tom Lane
Doc: mention CREATE+ATTACH PARTITION with CREATE TABLE...PARTITION OF. Clarify that ATTACH/DETACH PARTITION can be used to perform partition maintenance with less locking than straight CREATE TABLE/DROP TABLE. This was already stated in some places, but not emphasized. Back-patch to v14 where DET

pgsql: Doc: mention CREATE+ATTACH PARTITION with CREATE TABLE...PARTITI

2023-03-16 Thread Tom Lane
Doc: mention CREATE+ATTACH PARTITION with CREATE TABLE...PARTITION OF. Clarify that ATTACH/DETACH PARTITION can be used to perform partition maintenance with less locking than straight CREATE TABLE/DROP TABLE. This was already stated in some places, but not emphasized. Back-patch to v14 where DET

pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b. A comment was left behind claiming that we needed to use malloc() rather than palloc() because the corresponding free would run in another thread, but that's not true anymore. Remove that comment. And, with the reason being gone, we might as well actually use pa

pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b. A comment was left behind claiming that we needed to use malloc() rather than palloc() because the corresponding free would run in another thread, but that's not true anymore. Remove that comment. And, with the reason being gone, we might as well actually use pa

pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b. A comment was left behind claiming that we needed to use malloc() rather than palloc() because the corresponding free would run in another thread, but that's not true anymore. Remove that comment. And, with the reason being gone, we might as well actually use pa

pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b. A comment was left behind claiming that we needed to use malloc() rather than palloc() because the corresponding free would run in another thread, but that's not true anymore. Remove that comment. And, with the reason being gone, we might as well actually use pa

pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b. A comment was left behind claiming that we needed to use malloc() rather than palloc() because the corresponding free would run in another thread, but that's not true anymore. Remove that comment. And, with the reason being gone, we might as well actually use pa

pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b. A comment was left behind claiming that we needed to use malloc() rather than palloc() because the corresponding free would run in another thread, but that's not true anymore. Remove that comment. And, with the reason being gone, we might as well actually use pa

pgsql: Work around spurious compiler warning in inet operators

2023-03-16 Thread Andres Freund
Work around spurious compiler warning in inet operators gcc 12+ has complaints like the following: ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': ../../../../../pgsql/src/backend/utils/adt/network.c:1893:34: warning: writing 1 byte into a region of size 0 [-Wstringo

pgsql: Work around spurious compiler warning in inet operators

2023-03-16 Thread Andres Freund
Work around spurious compiler warning in inet operators gcc 12+ has complaints like the following: ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': ../../../../../pgsql/src/backend/utils/adt/network.c:1893:34: warning: writing 1 byte into a region of size 0 [-Wstringo

pgsql: Work around spurious compiler warning in inet operators

2023-03-16 Thread Andres Freund
Work around spurious compiler warning in inet operators gcc 12+ has complaints like the following: ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': ../../../../../pgsql/src/backend/utils/adt/network.c:1893:34: warning: writing 1 byte into a region of size 0 [-Wstringo

pgsql: Work around spurious compiler warning in inet operators

2023-03-16 Thread Andres Freund
Work around spurious compiler warning in inet operators gcc 12+ has complaints like the following: ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': ../../../../../pgsql/src/backend/utils/adt/network.c:1893:34: warning: writing 1 byte into a region of size 0 [-Wstringo

pgsql: Work around spurious compiler warning in inet operators

2023-03-16 Thread Andres Freund
Work around spurious compiler warning in inet operators gcc 12+ has complaints like the following: ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': ../../../../../pgsql/src/backend/utils/adt/network.c:1893:34: warning: writing 1 byte into a region of size 0 [-Wstringo

pgsql: Work around spurious compiler warning in inet operators

2023-03-16 Thread Andres Freund
Work around spurious compiler warning in inet operators gcc 12+ has complaints like the following: ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': ../../../../../pgsql/src/backend/utils/adt/network.c:1893:34: warning: writing 1 byte into a region of size 0 [-Wstringo

pgsql: Enable use of Memoize atop an Append that came from UNION ALL.

2023-03-16 Thread Tom Lane
Enable use of Memoize atop an Append that came from UNION ALL. create_append_path() would only apply get_baserel_parampathinfo when the path is for a partitioned table, but it's also potentially useful for paths for UNION ALL appendrels. Specifically, that supports building a Memoize path atop th

Re: pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Tom Lane
Thomas Munro writes: > Small tidyup for commit d41a178b. > A comment was left behind claiming that we needed to use malloc() rather > than palloc() because the corresponding free would run in another > thread, but that's not true anymore. Remove that comment. And, with > the reason being gone, w

Re: pgsql: Small tidyup for commit d41a178b.

2023-03-16 Thread Thomas Munro
On Fri, Mar 17, 2023 at 1:36 PM Tom Lane wrote: > Thomas Munro writes: > > Small tidyup for commit d41a178b. > > A comment was left behind claiming that we needed to use malloc() rather > > than palloc() because the corresponding free would run in another > > thread, but that's not true anymore.

pgsql: Small tidyup for commit d41a178b, part II.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b, part II. Further to commit 6a9229da, checking for NULL is now redundant. An "out of memory" error would have been thrown already by palloc() and treated as FATAL, so we can delete a few more lines. Back-patch to all releases, like those other commits. Reported-

pgsql: Small tidyup for commit d41a178b, part II.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b, part II. Further to commit 6a9229da, checking for NULL is now redundant. An "out of memory" error would have been thrown already by palloc() and treated as FATAL, so we can delete a few more lines. Back-patch to all releases, like those other commits. Reported-

pgsql: Small tidyup for commit d41a178b, part II.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b, part II. Further to commit 6a9229da, checking for NULL is now redundant. An "out of memory" error would have been thrown already by palloc() and treated as FATAL, so we can delete a few more lines. Back-patch to all releases, like those other commits. Reported-

pgsql: Small tidyup for commit d41a178b, part II.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b, part II. Further to commit 6a9229da, checking for NULL is now redundant. An "out of memory" error would have been thrown already by palloc() and treated as FATAL, so we can delete a few more lines. Back-patch to all releases, like those other commits. Reported-

pgsql: Small tidyup for commit d41a178b, part II.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b, part II. Further to commit 6a9229da, checking for NULL is now redundant. An "out of memory" error would have been thrown already by palloc() and treated as FATAL, so we can delete a few more lines. Back-patch to all releases, like those other commits. Reported-

pgsql: Small tidyup for commit d41a178b, part II.

2023-03-16 Thread Thomas Munro
Small tidyup for commit d41a178b, part II. Further to commit 6a9229da, checking for NULL is now redundant. An "out of memory" error would have been thrown already by palloc() and treated as FATAL, so we can delete a few more lines. Back-patch to all releases, like those other commits. Reported-

pgsql: libpq: Remove code for SCM credential authentication

2023-03-16 Thread Michael Paquier
libpq: Remove code for SCM credential authentication Support for SCM credential authentication has been removed in the backend in 9.1, and libpq has kept some code to handle it for compatibility. Commit be4585b, that did the cleanup of the backend code, has done so because the code was not really

pgsql: tests: Minimize syslog activity by slapd

2023-03-16 Thread Andres Freund
tests: Minimize syslog activity by slapd Until now the tests using slapd spammed syslog for every connection / query. Use logfile-only to prevent syslog activity. Unfortunately that only takes effect after logging the first message, but that's still much better than the prior situation. Discussio

pgsql: tests: Minimize syslog activity by slapd

2023-03-16 Thread Andres Freund
tests: Minimize syslog activity by slapd Until now the tests using slapd spammed syslog for every connection / query. Use logfile-only to prevent syslog activity. Unfortunately that only takes effect after logging the first message, but that's still much better than the prior situation. Discussio

pgsql: tests: Minimize syslog activity by slapd

2023-03-16 Thread Andres Freund
tests: Minimize syslog activity by slapd Until now the tests using slapd spammed syslog for every connection / query. Use logfile-only to prevent syslog activity. Unfortunately that only takes effect after logging the first message, but that's still much better than the prior situation. Discussio

pgsql: tests: Minimize syslog activity by slapd

2023-03-16 Thread Andres Freund
tests: Minimize syslog activity by slapd Until now the tests using slapd spammed syslog for every connection / query. Use logfile-only to prevent syslog activity. Unfortunately that only takes effect after logging the first message, but that's still much better than the prior situation. Discussio

pgsql: tests: Minimize syslog activity by slapd

2023-03-16 Thread Andres Freund
tests: Minimize syslog activity by slapd Until now the tests using slapd spammed syslog for every connection / query. Use logfile-only to prevent syslog activity. Unfortunately that only takes effect after logging the first message, but that's still much better than the prior situation. Discussio

pgsql: tests: Minimize syslog activity by slapd

2023-03-16 Thread Andres Freund
tests: Minimize syslog activity by slapd Until now the tests using slapd spammed syslog for every connection / query. Use logfile-only to prevent syslog activity. Unfortunately that only takes effect after logging the first message, but that's still much better than the prior situation. Discussio

pgsql: Fix incorrect logic for determining safe WindowAgg run condition

2023-03-16 Thread David Rowley
Fix incorrect logic for determining safe WindowAgg run conditions The logic added in 9d9c02ccd to determine when a qual can be used as a WindowClause run condition failed to correctly check for subqueries in the qual. This was being done correctly for normal subquery qual pushdowns, it's just tha

pgsql: Fix incorrect logic for determining safe WindowAgg run condition

2023-03-16 Thread David Rowley
Fix incorrect logic for determining safe WindowAgg run conditions The logic added in 9d9c02ccd to determine when a qual can be used as a WindowClause run condition failed to correctly check for subqueries in the qual. This was being done correctly for normal subquery qual pushdowns, it's just tha

pgsql: Add macros for ReorderBufferTXN toptxn.

2023-03-16 Thread Amit Kapila
Add macros for ReorderBufferTXN toptxn. Currently, there are quite a few places in reorderbuffer.c that tries to access top-transaction for a subtransaction. This makes the code to access top-transaction consistent and easier to follow. Author: Peter Smith Reviewed-by: Vignesh C, Sawada Masahiko

pgsql: tests: Prevent syslog activity by slapd, take 2

2023-03-16 Thread Andres Freund
tests: Prevent syslog activity by slapd, take 2 Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only

pgsql: tests: Prevent syslog activity by slapd, take 2

2023-03-16 Thread Andres Freund
tests: Prevent syslog activity by slapd, take 2 Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only

pgsql: tests: Prevent syslog activity by slapd, take 2

2023-03-16 Thread Andres Freund
tests: Prevent syslog activity by slapd, take 2 Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only

pgsql: tests: Prevent syslog activity by slapd, take 2

2023-03-16 Thread Andres Freund
tests: Prevent syslog activity by slapd, take 2 Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only

pgsql: tests: Prevent syslog activity by slapd, take 2

2023-03-16 Thread Andres Freund
tests: Prevent syslog activity by slapd, take 2 Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only

pgsql: tests: Prevent syslog activity by slapd, take 2

2023-03-16 Thread Andres Freund
tests: Prevent syslog activity by slapd, take 2 Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only

pgsql: Fix incorrect format placeholders

2023-03-16 Thread Peter Eisentraut
Fix incorrect format placeholders Small fixup for 9637badd9f. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/95a828378ed243a1b37cab6bda99746bfc0af509 Modified Files -- src/bin/pg_upgrade/pg_upgrade.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion