pgsql: Use dlists instead of SHM_QUEUE for predicate locking

2023-01-19 Thread Andres Freund
Use dlists instead of SHM_QUEUE for predicate locking Part of a series to remove SHM_QUEUE. ilist.h style lists are more widely used and have an easier to use interface. Reviewed-by: Thomas Munro (in an older version) Discussion: https://postgr.es/m/[email protected]

pgsql: Remove SHM_QUEUE

2023-01-19 Thread Andres Freund
Remove SHM_QUEUE Prior patches got rid of all the uses of SHM_QUEUE. ilist.h style lists are more widely used and have an easier to use interface. As there are no users left, remove SHM_QUEUE. Reviewed-by: Thomas Munro (in an older version) Discussion: https://postgr.es/m/20221120055930.t6kl3ty

pgsql: Improve the description of Output Plugin Callbacks.

2023-01-19 Thread Amit Kapila
Improve the description of Output Plugin Callbacks. We were inconsistently specifying the required and optional marking for plugin callbacks. Additionally, this patch improves the description for stream_prepare callback. Author: Wang wei Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/o

pgsql: Support the same patterns for pg-user in pg_ident.conf as in pg_

2023-01-19 Thread Michael Paquier
Support the same patterns for pg-user in pg_ident.conf as in pg_hba.conf While pg_hba.conf has support for non-literal username matches, and this commit extends the capabilities that are supported for the PostgreSQL user listed in an ident entry part of pg_ident.conf, with support for: 1. The "all

pgsql: Avoid harmless warning from pg_dump --if-exists mode.

2023-01-19 Thread Tom Lane
Avoid harmless warning from pg_dump --if-exists mode. If the public schema has a non-default owner (perhaps due to dropping and recreating it) then use of pg_dump's "--if-exists" option results in a warning message: warning: could not find where to insert IF EXISTS in statement "-- *not* droppin

pgsql: Avoid harmless warning from pg_dump --if-exists mode.

2023-01-19 Thread Tom Lane
Avoid harmless warning from pg_dump --if-exists mode. If the public schema has a non-default owner (perhaps due to dropping and recreating it) then use of pg_dump's "--if-exists" option results in a warning message: warning: could not find where to insert IF EXISTS in statement "-- *not* droppin

pgsql: Use appendStringInfoSpaces in more places

2023-01-19 Thread David Rowley
Use appendStringInfoSpaces in more places This adjusts a few places which were appending a string constant containing spaces onto a StringInfo. We have appendStringInfoSpaces for that job, so let's use that instead. For the change to jsonb.c's add_indent() function, appendStringInfoString was be

pgsql: Improve comment about GetWALAvailability's WALAVAIL_REMOVED code

2023-01-19 Thread Tom Lane
Improve comment about GetWALAvailability's WALAVAIL_REMOVED code. Sirisha Chamarthi and Kyotaro Horiguchi Discussion: https://postgr.es/m/CAKrAKeXt-=bgm=d+edmcc9kwoikp8kbvb3lh0k3k+aggsyk...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1ca604c2018

pgsql: Fix ts_headline() to handle ORs and phrase queries more honestly

2023-01-19 Thread Tom Lane
Fix ts_headline() to handle ORs and phrase queries more honestly. This patch largely reverts what I did in commits c9b0c678d and 78e73e875. The maximum cover length limit that I added in 78e73e875 (to band-aid over c9b0c678d's performance issues) creates too many user-visible behavior discrepanci

Re: pgsql: Remove some dead code in selfuncs.c

2023-01-19 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Jan-19, Tom Lane wrote: >> Ah, sorry, -ENOCAFFEINE. It's talking about the access-as-user field, >> not the relation's owner. I agree that as querytrees are currently >> built, this is probably a safe optimization. But do we really want >> to hard-wire such a su

Re: pgsql: Remove some dead code in selfuncs.c

2023-01-19 Thread Alvaro Herrera
On 2023-Jan-19, Tom Lane wrote: > I wrote: > > Alvaro Herrera writes: > >> Remove some dead code in selfuncs.c > >> RelOptInfo.userid is the same for all relations in a given inheritance > >> tree, so the code in examine_variable() and example_simple_variable() > >> that repeats the ACL checks on

pgsql: Log the correct ending timestamp in recovery_target_xid mode.

2023-01-19 Thread Tom Lane
Log the correct ending timestamp in recovery_target_xid mode. When ending recovery based on recovery_target_xid matching with recovery_target_inclusive = off, we printed an incorrect timestamp (always 2000-01-01) in the "recovery stopping before ... transaction" log message. This is a consequence

pgsql: Log the correct ending timestamp in recovery_target_xid mode.

2023-01-19 Thread Tom Lane
Log the correct ending timestamp in recovery_target_xid mode. When ending recovery based on recovery_target_xid matching with recovery_target_inclusive = off, we printed an incorrect timestamp (always 2000-01-01) in the "recovery stopping before ... transaction" log message. This is a consequence

pgsql: Log the correct ending timestamp in recovery_target_xid mode.

2023-01-19 Thread Tom Lane
Log the correct ending timestamp in recovery_target_xid mode. When ending recovery based on recovery_target_xid matching with recovery_target_inclusive = off, we printed an incorrect timestamp (always 2000-01-01) in the "recovery stopping before ... transaction" log message. This is a consequence

pgsql: Log the correct ending timestamp in recovery_target_xid mode.

2023-01-19 Thread Tom Lane
Log the correct ending timestamp in recovery_target_xid mode. When ending recovery based on recovery_target_xid matching with recovery_target_inclusive = off, we printed an incorrect timestamp (always 2000-01-01) in the "recovery stopping before ... transaction" log message. This is a consequence

pgsql: Log the correct ending timestamp in recovery_target_xid mode.

2023-01-19 Thread Tom Lane
Log the correct ending timestamp in recovery_target_xid mode. When ending recovery based on recovery_target_xid matching with recovery_target_inclusive = off, we printed an incorrect timestamp (always 2000-01-01) in the "recovery stopping before ... transaction" log message. This is a consequence

pgsql: Log the correct ending timestamp in recovery_target_xid mode.

2023-01-19 Thread Tom Lane
Log the correct ending timestamp in recovery_target_xid mode. When ending recovery based on recovery_target_xid matching with recovery_target_inclusive = off, we printed an incorrect timestamp (always 2000-01-01) in the "recovery stopping before ... transaction" log message. This is a consequence

pgsql: Keep perl style checker happy

2023-01-19 Thread Andrew Dunstan
Keep perl style checker happy It doesn't like code before "use strict;". (cherry picked from commit ed2c2d063bd110f299211611b72a5dbe07a4d7be) Branch -- REL9_3_STABLE Details --- https://git.postgresql.org/pg/commitdiff/524440579f838b30579f35d2045cc01b6f5070d8 Modified Files ---

pgsql: Fix searchpath for modern Perl for genbki.pl

2023-01-19 Thread Andrew Dunstan
Fix searchpath for modern Perl for genbki.pl This was fixed for MSVC tools by commit 1df92eeafefac4, but per buildfarm member bowerbird genbki.pl needs the same treatment. Backpatch to all live branches. (cherry picked from commit 51884fa16a179852ec851172a72588d8e84ec05e) Branch -- REL9_3_S

pgsql: Fix searchpath for modern Perl for genbki.pl

2023-01-19 Thread Andrew Dunstan
Fix searchpath for modern Perl for genbki.pl This was fixed for MSVC tools by commit 1df92eeafefac4, but per buildfarm member bowerbird genbki.pl needs the same treatment. Backpatch to all live branches. (cherry picked from commit 51884fa16a179852ec851172a72588d8e84ec05e) Branch -- REL9_2_S

pgsql: Keep perl style checker happy

2023-01-19 Thread Andrew Dunstan
Keep perl style checker happy It doesn't like code before "use strict;". (cherry picked from commit ed2c2d063bd110f299211611b72a5dbe07a4d7be) Branch -- REL9_2_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4c1f42f588917225db16f3a6de62411a51bf3037 Modified Files ---

Re: pgsql: Remove some dead code in selfuncs.c

2023-01-19 Thread Tom Lane
I wrote: > Alvaro Herrera writes: >> Remove some dead code in selfuncs.c >> RelOptInfo.userid is the same for all relations in a given inheritance >> tree, so the code in examine_variable() and example_simple_variable() >> that repeats the ACL checks on the root parent rel instead of a given >> le

Re: pgsql: Remove some dead code in selfuncs.c

2023-01-19 Thread Tom Lane
Alvaro Herrera writes: > Remove some dead code in selfuncs.c > RelOptInfo.userid is the same for all relations in a given inheritance > tree, so the code in examine_variable() and example_simple_variable() > that repeats the ACL checks on the root parent rel instead of a given > leaf child relatio

pgsql: Remove some dead code in selfuncs.c

2023-01-19 Thread Alvaro Herrera
Remove some dead code in selfuncs.c RelOptInfo.userid is the same for all relations in a given inheritance tree, so the code in examine_variable() and example_simple_variable() that repeats the ACL checks on the root parent rel instead of a given leaf child relations need not recompute userid too.

pgsql: Constify proclist.h

2023-01-19 Thread Peter Eisentraut
Constify proclist.h This is a follow-up to c8ad4d81. Author: AleksanderĀ Alekseev Discussion: https://www.postgresql.org/message-id/flat/CAJ7c6TM084Ai_8%3DfZaWtULJBLtT1bgzL%3Dk9vHMYom3eyZsekAA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4888084