Re: pgsql: pg_createsubscriber: creates a new logical replica from a standb

2024-03-25 Thread Kyotaro Horiguchi
Hello. This commit added the following error message: pg_createsubscriber.c: 375 > pg_fatal("could not access directory \"%s\": %s", > datadir, >strerror(errno)); Although other messages use %s with PQresultErrorMessage(), regarding

pgsql: Fix inconsistent function prototypes with function definitions.

2024-03-25 Thread Masahiko Sawada
Fix inconsistent function prototypes with function definitions. Introduced by 30e144287a. Reviewed-by: John Naylor Discussion: https://postgr.es/m/CAD21AoCaDT%2B-ZaVjbtvumms0tyyHPNLELK2UX-MLG9XCgioaNw%40mail.gmail.com Branch -- master Details ---

pgsql: Fix a calculation in TidStoreCreate().

2024-03-25 Thread Masahiko Sawada
Fix a calculation in TidStoreCreate(). Since we expect that the max_bytes is in bytes, not in kilobytes, it should not be multiplied by 1024. Introduced by 30e144287a. Reported-by: John Naylor, David Rowley Reviewed-by: John Naylor Discussion:

Re: pgsql: Add TIDStore, to store sets of TIDs (ItemPointerData) efficientl

2024-03-25 Thread Masahiko Sawada
On Tue, Mar 26, 2024 at 12:22 PM John Naylor wrote: > > On Tue, Mar 26, 2024 at 9:36 AM Masahiko Sawada wrote: > > > > On Tue, Mar 26, 2024 at 7:16 AM David Rowley wrote: > > > > > > Either "max_bytes" is a bad name for this variable or the * 1024L > > > should be removed. > > > > > > > Right.

pgsql: Avoid edge case in pg_visibility test with small shared_buffers

2024-03-25 Thread Andres Freund
Avoid edge case in pg_visibility test with small shared_buffers Since 82a4edabd27 we can bulk extend relations. The bulk relation extension logic has a heuristic component. Normally the heurstic does not trigger in the occasionally-failing test case, as the relation is only extended once. But

pgsql: Avoid edge case in pg_visibility test with small shared_buffers

2024-03-25 Thread Andres Freund
Avoid edge case in pg_visibility test with small shared_buffers Since 82a4edabd27 we can bulk extend relations. The bulk relation extension logic has a heuristic component. Normally the heurstic does not trigger in the occasionally-failing test case, as the relation is only extended once. But

Re: pgsql: Add TIDStore, to store sets of TIDs (ItemPointerData) efficientl

2024-03-25 Thread John Naylor
On Tue, Mar 26, 2024 at 9:36 AM Masahiko Sawada wrote: > > On Tue, Mar 26, 2024 at 7:16 AM David Rowley wrote: > > > > Either "max_bytes" is a bad name for this variable or the * 1024L > > should be removed. > > > > Right. We discussed it on the original thread too[1]. Since we're > going to

Re: pgsql: Add TIDStore, to store sets of TIDs (ItemPointerData) efficientl

2024-03-25 Thread Masahiko Sawada
On Tue, Mar 26, 2024 at 7:16 AM David Rowley wrote: > > On Thu, 21 Mar 2024 at 14:10, Masahiko Sawada wrote: > > > > Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently. > > > src/backend/access/common/tidstore.c | 463 > > + > > I was looking at

pgsql: Add comments on some MinimalTupleSlots methods usage

2024-03-25 Thread Alexander Korotkov
Add comments on some MinimalTupleSlots methods usage Discussion: https://postgr.es/m/CALT9ZEHNeagO5PLb4Nv9J_ZaCtp%2BArdVmbSLc0RHUzx_RPAa4w%40mail.gmail.com Author: Pavel Borisov Branch -- master Details ---

pgsql: Improve error message for tts_(virtual|minimal)_is_current_xact_

2024-03-25 Thread Alexander Korotkov
Improve error message for tts_(virtual|minimal)_is_current_xact_tuple Discussion: https://postgr.es/m/CALT9ZEHNeagO5PLb4Nv9J_ZaCtp%2BArdVmbSLc0RHUzx_RPAa4w%40mail.gmail.com Author: Pavel Borisov Branch -- master Details ---

pgsql: ci: macos: Choose python version

2024-03-25 Thread Andres Freund
ci: macos: Choose python version The CI base image used to have a python3 with headers etc installed in PATH, but doesn't anymore. Instead of relying on a specific version in the base image, explicitly install one ourselves. On 16 and HEAD this lead to a build without python support, but on 15

pgsql: ci: macos: Choose python version

2024-03-25 Thread Andres Freund
ci: macos: Choose python version The CI base image used to have a python3 with headers etc installed in PATH, but doesn't anymore. Instead of relying on a specific version in the base image, explicitly install one ourselves. On 16 and HEAD this lead to a build without python support, but on 15

pgsql: ci: macos: Choose python version

2024-03-25 Thread Andres Freund
ci: macos: Choose python version The CI base image used to have a python3 with headers etc installed in PATH, but doesn't anymore. Instead of relying on a specific version in the base image, explicitly install one ourselves. On 16 and HEAD this lead to a build without python support, but on 15

pgsql: Allow locking updated tuples in tuple_update() and tuple_delete(

2024-03-25 Thread Alexander Korotkov
Allow locking updated tuples in tuple_update() and tuple_delete() Currently, in read committed transaction isolation mode (default), we have the following sequence of actions when tuple_update()/tuple_delete() finds the tuple updated by the concurrent transaction. 1. Attempt to update/delete

pgsql: Add EvalPlanQual delete returning isolation test

2024-03-25 Thread Alexander Korotkov
Add EvalPlanQual delete returning isolation test Author: Andres Freund Reviewed-by: Pavel Borisov Discussion: https://www.postgresql.org/message-id/flat/CAPpHfdua-YFw3XTprfutzGp28xXLigFtzNbuFY8yPhqeq6X5kg%40mail.gmail.com Branch -- master Details ---

Re: pgsql: make dist uses git archive

2024-03-25 Thread Andrew Dunstan
On Mon, Mar 25, 2024 at 5:22 PM Magnus Hagander wrote: > > > On Mon, Mar 25, 2024 at 8:30 PM Peter Eisentraut > wrote: > >> On 25.03.24 10:04, Magnus Hagander wrote: >> > This seems to have broken buildfarm member guaibasaurus, which I >> believe >> > is the only one that runs "make dist" as

Re: pgsql: Add TIDStore, to store sets of TIDs (ItemPointerData) efficientl

2024-03-25 Thread David Rowley
On Thu, 21 Mar 2024 at 14:10, Masahiko Sawada wrote: > > Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently. > src/backend/access/common/tidstore.c | 463 + I was looking at this code and I saw the following: /* choose the maxBlockSize to be no

pgsql: Refactor predicate_{implied,refuted}_by_simple_clause.

2024-03-25 Thread Tom Lane
Refactor predicate_{implied,refuted}_by_simple_clause. Put the node-type-dependent operations into switches on nodeTag. This should ease addition of new proof rules for other expression node types. There is no functional change, although some tests are made in a different order than before.

Re: pgsql: make dist uses git archive

2024-03-25 Thread Magnus Hagander
On Mon, Mar 25, 2024 at 8:30 PM Peter Eisentraut wrote: > On 25.03.24 10:04, Magnus Hagander wrote: > > This seems to have broken buildfarm member guaibasaurus, which I believe > > is the only one that runs "make dist" as part of the buildfarm. And as a > > result,t hat breaks the snapshot build

Re: pgsql: make dist uses git archive

2024-03-25 Thread Peter Eisentraut
On 25.03.24 10:04, Magnus Hagander wrote: This seems to have broken buildfarm member guaibasaurus, which I believe is the only one that runs "make dist" as part of the buildfarm. And as a result,t hat breaks the snapshot build uploads. I don't know exactly how it does it, it appears to not

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/abcea19abf3bd9dfbb4d4b9571ee7a522eb52893 Modified Files --

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/24d1b9989134e96f643ba31cd0e379fce5062534 Modified Files --

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b74e4a08b9835e18a14fd3f23e19ddd460ed5b88 Modified Files --

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/022068ea2c60fd0b1ec9b9be5d1cc680b640335c Modified Files --

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bc5fcaa289a92941a1c7b191c7c9311bd742e172 Modified Files --

pgsql: Adjust pgbench option for debug mode.

2024-03-25 Thread Nathan Bossart
Adjust pgbench option for debug mode. Many other utilities use -d to specify the database to use, but pgbench uses it to enable debug mode. This is causing some users to accidentally enable it. This commit changes -d to accept the database name and introduces --dbname. Debug mode can still be

pgsql: Allow specifying an access method for partitioned tables

2024-03-25 Thread Alvaro Herrera
Allow specifying an access method for partitioned tables It's now possible to specify a table access method via CREATE TABLE ... USING for a partitioned table, as well change it with ALTER TABLE ... SET ACCESS METHOD. Specifying an AM for a partitioned table lets the value be used for all future

pgsql: Fix typo in comment

2024-03-25 Thread Daniel Gustafsson
Fix typo in comment Spotted while reviewing a patch changing things around this area. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b8528fe026b18976b5d5b4fcb066a8a55def3375 Modified Files -- src/interfaces/libpq/fe-cancel.c | 2 +- 1 file changed, 1

pgsql: doc: Document error handling in PGTYPESnumeric_to_long

2024-03-25 Thread Daniel Gustafsson
doc: Document error handling in PGTYPESnumeric_to_long The documentation for PGTYPESnumeric_to_long only mentioned errno being set to indicate overflow but the code also sets errno when underflow happens. Reported-by: Aidar Imamov Discussion:

pgsql: Fix indentation from a11f330b5

2024-03-25 Thread Daniel Gustafsson
Fix indentation from a11f330b5 Per buildfarm animal koel Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/64e401b62b1559d617db5c1e1070d7a05e794c27 Modified Files -- src/backend/replication/slot.c | 8 1 file changed, 4 insertions(+), 4

pgsql: ecpg: Fix return code for overflow in numeric conversion

2024-03-25 Thread Daniel Gustafsson
ecpg: Fix return code for overflow in numeric conversion The decimal conversion functions dectoint and dectolong are documented to return ECPG_INFORMIX_NUM_OVERFLOW in case of overflows, but always returned -1 on all errors due to incorrectly checking the returnvalue from the PGTYPES* functions.

pgsql: Merge prune, freeze and vacuum WAL record formats

2024-03-25 Thread Heikki Linnakangas
Merge prune, freeze and vacuum WAL record formats The new combined WAL record is now used for pruning, freezing and 2nd pass of vacuum. This is in preparation for changing VACUUM to write a combined prune+freeze record per page, instead of separate two records. The new WAL record format now

Re: pgsql: Do not translate dummy SpecialJoinInfos for child joins

2024-03-25 Thread Alvaro Herrera
On 2024-Mar-25, Amit Langote wrote: > I noticed a failure that I don't know what to make of after this and > the other commit (5278d0a2e) reached the buildfarm animal morepork: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=morepork=2024-03-25%2009%3A30%3A38 > > In file included

pgsql: pg_createsubscriber: creates a new logical replica from a standb

2024-03-25 Thread Peter Eisentraut
pg_createsubscriber: creates a new logical replica from a standby server It must be run on the target server and should be able to connect to the source server (publisher) and the target server (subscriber). All tables in the specified database(s) are included in the logical replication setup.

pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-25 Thread Amit Kapila
Track last_inactive_time in pg_replication_slots. This commit adds a new property called last_inactive_time for slots. It is set to 0 whenever a slot is made active/acquired and set to the current timestamp whenever the slot is inactive/released or restored from the disk. Note that we don't set

pgsql: Code review for 6190d828cd2

2024-03-25 Thread Amit Langote
Code review for 6190d828cd2 * Fix the comment of init_dummy_sjinfo() to remove references to non-existing parameters 'rel1' and 'rel2'. * Adjust consider_new_or_clause() to call init_dummy_sjinfo() to make up a SpecialJoinInfo for inner joins like other code sites that were adjusted in

Re: pgsql: Do not translate dummy SpecialJoinInfos for child joins

2024-03-25 Thread Amit Langote
On Mon, Mar 25, 2024 at 6:08 PM Amit Langote wrote: > Do not translate dummy SpecialJoinInfos for child joins > > This teaches build_child_join_sjinfo() to create the dummy > SpecialJoinInfos (those created for inner joins) directly for a given > child join, skipping the unnecessary overhead of

pgsql: reindexdb: Fix warning about uninitialized indices_tables_cell

2024-03-25 Thread Alexander Korotkov
reindexdb: Fix warning about uninitialized indices_tables_cell Initialize indices_tables_cell with NULL to silence the warning. Also, refactor the place of the first assignment of indices_tables_cell. Reported-by: Thomas Munro, David Rowley, Tom Lane, Richard Guo Discussion:

pgsql: Reduce memory used by partitionwise joins

2024-03-25 Thread Amit Langote
Reduce memory used by partitionwise joins Specifically, this commit reduces the memory consumed by the SpecialJoinInfos that are allocated for child joins in try_partitionwise_join() by freeing them at the end of creating paths for each child join. A SpecialJoinInfo allocated for a given child

pgsql: Do not translate dummy SpecialJoinInfos for child joins

2024-03-25 Thread Amit Langote
Do not translate dummy SpecialJoinInfos for child joins This teaches build_child_join_sjinfo() to create the dummy SpecialJoinInfos (those created for inner joins) directly for a given child join, skipping the unnecessary overhead of translating the parent joinrel's SpecialJoinInfo. To that end,

Re: pgsql: make dist uses git archive

2024-03-25 Thread Magnus Hagander
This seems to have broken buildfarm member guaibasaurus, which I believe is the only one that runs "make dist" as part of the buildfarm. And as a result,t hat breaks the snapshot build uploads. I don't know exactly how it does it, it appears to not run from within the git repository. It might be