pgsql: postgres_fdw: Disable batch insert when BEFORE ROW INSERT trigge

2022-04-20 Thread Etsuro Fujita
postgres_fdw: Disable batch insert when BEFORE ROW INSERT triggers exist. Previously, we allowed this, but such triggers might query the table to insert into and act differently if the tuples that have already been processed and prepared for insertion are not there, so disable it in such cases. B

pgsql: postgres_fdw: Disable batch insert when BEFORE ROW INSERT trigge

2022-04-20 Thread Etsuro Fujita
postgres_fdw: Disable batch insert when BEFORE ROW INSERT triggers exist. Previously, we allowed this, but such triggers might query the table to insert into and act differently if the tuples that have already been processed and prepared for insertion are not there, so disable it in such cases. B

pgsql: vacuumlazy.c: MultiXactIds are MXIDs, not XMIDs.

2022-04-20 Thread Peter Geoghegan
vacuumlazy.c: MultiXactIds are MXIDs, not XMIDs. Oversights in commits 0b018fab and f3c15cbe. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ba6af6aa0b764d76cfca79d9dfbddc7134a16bfc Modified Files -- src/backend/access/heap/vacuumlazy.c | 6 +++--- 1 fi

pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.

2022-04-20 Thread Peter Geoghegan
Fix CLUSTER tuplesorts on abbreviated expressions. CLUSTER sort won't use the datum1 SortTuple field when clustering against an index whose leading key is an expression. This makes it unsafe to use the abbreviated keys optimization, which was missed by the logic that sets up SortSupport state. A

pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.

2022-04-20 Thread Peter Geoghegan
Fix CLUSTER tuplesorts on abbreviated expressions. CLUSTER sort won't use the datum1 SortTuple field when clustering against an index whose leading key is an expression. This makes it unsafe to use the abbreviated keys optimization, which was missed by the logic that sets up SortSupport state. A

pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.

2022-04-20 Thread Peter Geoghegan
Fix CLUSTER tuplesorts on abbreviated expressions. CLUSTER sort won't use the datum1 SortTuple field when clustering against an index whose leading key is an expression. This makes it unsafe to use the abbreviated keys optimization, which was missed by the logic that sets up SortSupport state. A

pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.

2022-04-20 Thread Peter Geoghegan
Fix CLUSTER tuplesorts on abbreviated expressions. CLUSTER sort won't use the datum1 SortTuple field when clustering against an index whose leading key is an expression. This makes it unsafe to use the abbreviated keys optimization, which was missed by the logic that sets up SortSupport state. A

pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.

2022-04-20 Thread Peter Geoghegan
Fix CLUSTER tuplesorts on abbreviated expressions. CLUSTER sort won't use the datum1 SortTuple field when clustering against an index whose leading key is an expression. This makes it unsafe to use the abbreviated keys optimization, which was missed by the logic that sets up SortSupport state. A

pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.

2022-04-20 Thread Peter Geoghegan
Fix CLUSTER tuplesorts on abbreviated expressions. CLUSTER sort won't use the datum1 SortTuple field when clustering against an index whose leading key is an expression. This makes it unsafe to use the abbreviated keys optimization, which was missed by the logic that sets up SortSupport state. A

pgsql: Disallow infinite endpoints in generate_series() for timestamps.

2022-04-20 Thread Tom Lane
Disallow infinite endpoints in generate_series() for timestamps. Such cases will lead to infinite loops, so they're of no practical value. The numeric variant of generate_series() already threw error for this, so borrow its message wording. Per report from Richard Wesley. Back-patch to all supp

pgsql: Disallow infinite endpoints in generate_series() for timestamps.

2022-04-20 Thread Tom Lane
Disallow infinite endpoints in generate_series() for timestamps. Such cases will lead to infinite loops, so they're of no practical value. The numeric variant of generate_series() already threw error for this, so borrow its message wording. Per report from Richard Wesley. Back-patch to all supp

pgsql: Disallow infinite endpoints in generate_series() for timestamps.

2022-04-20 Thread Tom Lane
Disallow infinite endpoints in generate_series() for timestamps. Such cases will lead to infinite loops, so they're of no practical value. The numeric variant of generate_series() already threw error for this, so borrow its message wording. Per report from Richard Wesley. Back-patch to all supp

pgsql: Disallow infinite endpoints in generate_series() for timestamps.

2022-04-20 Thread Tom Lane
Disallow infinite endpoints in generate_series() for timestamps. Such cases will lead to infinite loops, so they're of no practical value. The numeric variant of generate_series() already threw error for this, so borrow its message wording. Per report from Richard Wesley. Back-patch to all supp

pgsql: Disallow infinite endpoints in generate_series() for timestamps.

2022-04-20 Thread Tom Lane
Disallow infinite endpoints in generate_series() for timestamps. Such cases will lead to infinite loops, so they're of no practical value. The numeric variant of generate_series() already threw error for this, so borrow its message wording. Per report from Richard Wesley. Back-patch to all supp

pgsql: Disallow infinite endpoints in generate_series() for timestamps.

2022-04-20 Thread Tom Lane
Disallow infinite endpoints in generate_series() for timestamps. Such cases will lead to infinite loops, so they're of no practical value. The numeric variant of generate_series() already threw error for this, so borrow its message wording. Per report from Richard Wesley. Back-patch to all supp

pgsql: Allow db.schema.table patterns, but complain about random garbag

2022-04-20 Thread Robert Haas
Allow db.schema.table patterns, but complain about random garbage. psql, pg_dump, and pg_amcheck share code to process object name patterns like 'foo*.bar*' to match all tables with names starting in 'bar' that are in schemas starting with 'foo'. Before v14, any number of extra name parts were sil

pgsql: Allow db.schema.table patterns, but complain about random garbag

2022-04-20 Thread Robert Haas
Allow db.schema.table patterns, but complain about random garbage. psql, pg_dump, and pg_amcheck share code to process object name patterns like 'foo*.bar*' to match all tables with names starting in 'bar' that are in schemas starting with 'foo'. Before v14, any number of extra name parts were sil

Re: pgsql: Fix some trailing whitespace in documentation files

2022-04-20 Thread Tom Lane
Bruce Momjian writes: > On Tue, Apr 19, 2022 at 08:57:23PM +0200, Daniel Gustafsson wrote: >> Mildly on-topic: Has the topic of a pgindent like process for docs been >> discussed at some point? The archives didn't turn up anything for me. > I don't remember any discussion of that. We have 'make

pgsql: Remove trailing whitespace from *.sgml files.

2022-04-20 Thread Tom Lane
Remove trailing whitespace from *.sgml files. Historically we've been lax about this, but seeing that we're not lax in C files, there doesn't seem to be a good reason to be so in the documentation. Remove the existing occurrences (mostly though not entirely in copied-n-pasted psql output), and mo

pgsql: Fix incorrect format placeholders

2022-04-20 Thread Peter Eisentraut
Fix incorrect format placeholders Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6c0f9f60f1c24aead1bfdd0ed294ac5b6f1d1ac1 Modified Files -- src/bin/pgbench/pgbench.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

pgsql: set_deparse_plan: Reuse variable to appease Coverity

2022-04-20 Thread Alvaro Herrera
set_deparse_plan: Reuse variable to appease Coverity Coverity complains that dpns->outer_plan is deferenced (to obtain ->targetlist) when possibly NULL. We can avoid this by using dpns->outer_tlist instead, which was already obtained a few lines up. The fact that we end up with dpns->inner_tli

pgsql: Move ModifyTableContext->lockmode to UpdateContext

2022-04-20 Thread Alvaro Herrera
Move ModifyTableContext->lockmode to UpdateContext Should have been done this way to start with, but I failed to notice This way we avoid some pointless initialization, and better contains the variable to exist in the scope where it is really used. Reviewed-by: Michaël Paquier Discussion: https:

pgsql: ExecModifyTable: use context.planSlot instead of planSlot

2022-04-20 Thread Alvaro Herrera
ExecModifyTable: use context.planSlot instead of planSlot There's no reason to keep a separate local variable when we have a place for it elsewhere. This allows to simplify some code. Reviewed-by: Michaël Paquier Discussion: https://postgr.es/m/[email protected] Branch -