pgsql: Harden nbtree deduplication posting split code.

2021-05-14 Thread Peter Geoghegan
Harden nbtree deduplication posting split code. Add a defensive "can't happen" error to code that handles nbtree posting list splits (promote an existing assertion). This avoids a segfault in the event of an insertion of a newitem that is somehow identical to an existing non-pivot tuple in the in

pgsql: Harden nbtree deduplication posting split code.

2021-05-14 Thread Peter Geoghegan
Harden nbtree deduplication posting split code. Add a defensive "can't happen" error to code that handles nbtree posting list splits (promote an existing assertion). This avoids a segfault in the event of an insertion of a newitem that is somehow identical to an existing non-pivot tuple in the in

pgsql: Doc: correct erroneous entry in this week's minor release notes.

2021-05-14 Thread Tom Lane
Doc: correct erroneous entry in this week's minor release notes. The patch to disallow a NULL specification in combination with GENERATED ... AS IDENTITY applied to both ALWAYS and BY DEFAULT variants of that clause, not only the former. Noted by Shay Rojansky. Discussion: https://postgr.es/m/C

pgsql: Doc: correct erroneous entry in this week's minor release notes.

2021-05-14 Thread Tom Lane
Doc: correct erroneous entry in this week's minor release notes. The patch to disallow a NULL specification in combination with GENERATED ... AS IDENTITY applied to both ALWAYS and BY DEFAULT variants of that clause, not only the former. Noted by Shay Rojansky. Discussion: https://postgr.es/m/C

pgsql: Doc: correct erroneous entry in this week's minor release notes.

2021-05-14 Thread Tom Lane
Doc: correct erroneous entry in this week's minor release notes. The patch to disallow a NULL specification in combination with GENERATED ... AS IDENTITY applied to both ALWAYS and BY DEFAULT variants of that clause, not only the former. Noted by Shay Rojansky. Discussion: https://postgr.es/m/C

pgsql: Doc: correct erroneous entry in this week's minor release notes.

2021-05-14 Thread Tom Lane
Doc: correct erroneous entry in this week's minor release notes. The patch to disallow a NULL specification in combination with GENERATED ... AS IDENTITY applied to both ALWAYS and BY DEFAULT variants of that clause, not only the former. Noted by Shay Rojansky. Discussion: https://postgr.es/m/C

pgsql: Prevent infinite insertion loops in spgdoinsert().

2021-05-14 Thread Tom Lane
Prevent infinite insertion loops in spgdoinsert(). Formerly we just relied on operator classes that assert longValuesOK to eventually shorten the leaf value enough to fit on an index page. That fails since the introduction of INCLUDE-column support (commit 09c1c6ab4), because the INCLUDE columns m

pgsql: Prevent infinite insertion loops in spgdoinsert().

2021-05-14 Thread Tom Lane
Prevent infinite insertion loops in spgdoinsert(). Formerly we just relied on operator classes that assert longValuesOK to eventually shorten the leaf value enough to fit on an index page. That fails since the introduction of INCLUDE-column support (commit 09c1c6ab4), because the INCLUDE columns m

pgsql: Prevent infinite insertion loops in spgdoinsert().

2021-05-14 Thread Tom Lane
Prevent infinite insertion loops in spgdoinsert(). Formerly we just relied on operator classes that assert longValuesOK to eventually shorten the leaf value enough to fit on an index page. That fails since the introduction of INCLUDE-column support (commit 09c1c6ab4), because the INCLUDE columns m

pgsql: Prevent infinite insertion loops in spgdoinsert().

2021-05-14 Thread Tom Lane
Prevent infinite insertion loops in spgdoinsert(). Formerly we just relied on operator classes that assert longValuesOK to eventually shorten the leaf value enough to fit on an index page. That fails since the introduction of INCLUDE-column support (commit 09c1c6ab4), because the INCLUDE columns m

pgsql: Prevent infinite insertion loops in spgdoinsert().

2021-05-14 Thread Tom Lane
Prevent infinite insertion loops in spgdoinsert(). Formerly we just relied on operator classes that assert longValuesOK to eventually shorten the leaf value enough to fit on an index page. That fails since the introduction of INCLUDE-column support (commit 09c1c6ab4), because the INCLUDE columns m

pgsql: Prevent infinite insertion loops in spgdoinsert().

2021-05-14 Thread Tom Lane
Prevent infinite insertion loops in spgdoinsert(). Formerly we just relied on operator classes that assert longValuesOK to eventually shorten the leaf value enough to fit on an index page. That fails since the introduction of INCLUDE-column support (commit 09c1c6ab4), because the INCLUDE columns m

pgsql: Refactor CHECK_FOR_INTERRUPTS() to add flexibility.

2021-05-14 Thread Tom Lane
Refactor CHECK_FOR_INTERRUPTS() to add flexibility. Split up CHECK_FOR_INTERRUPTS() to provide an additional macro INTERRUPTS_PENDING_CONDITION(), which just tests whether an interrupt is pending without attempting to service it. This is useful in situations where the caller knows that interrupts

pgsql: Fix query-cancel handling in spgdoinsert().

2021-05-14 Thread Tom Lane
Fix query-cancel handling in spgdoinsert(). Knowing that a buggy opclass could cause an infinite insertion loop, spgdoinsert() intended to allow its loop to be interrupted by query cancel. However, that never actually worked, because in iterations after the first, we'd be holding buffer lock(s) w

pgsql: Refactor CHECK_FOR_INTERRUPTS() to add flexibility.

2021-05-14 Thread Tom Lane
Refactor CHECK_FOR_INTERRUPTS() to add flexibility. Split up CHECK_FOR_INTERRUPTS() to provide an additional macro INTERRUPTS_PENDING_CONDITION(), which just tests whether an interrupt is pending without attempting to service it. This is useful in situations where the caller knows that interrupts

pgsql: Fix query-cancel handling in spgdoinsert().

2021-05-14 Thread Tom Lane
Fix query-cancel handling in spgdoinsert(). Knowing that a buggy opclass could cause an infinite insertion loop, spgdoinsert() intended to allow its loop to be interrupted by query cancel. However, that never actually worked, because in iterations after the first, we'd be holding buffer lock(s) w

pgsql: Fix query-cancel handling in spgdoinsert().

2021-05-14 Thread Tom Lane
Fix query-cancel handling in spgdoinsert(). Knowing that a buggy opclass could cause an infinite insertion loop, spgdoinsert() intended to allow its loop to be interrupted by query cancel. However, that never actually worked, because in iterations after the first, we'd be holding buffer lock(s) w

pgsql: Refactor CHECK_FOR_INTERRUPTS() to add flexibility.

2021-05-14 Thread Tom Lane
Refactor CHECK_FOR_INTERRUPTS() to add flexibility. Split up CHECK_FOR_INTERRUPTS() to provide an additional macro INTERRUPTS_PENDING_CONDITION(), which just tests whether an interrupt is pending without attempting to service it. This is useful in situations where the caller knows that interrupts

pgsql: Fix query-cancel handling in spgdoinsert().

2021-05-14 Thread Tom Lane
Fix query-cancel handling in spgdoinsert(). Knowing that a buggy opclass could cause an infinite insertion loop, spgdoinsert() intended to allow its loop to be interrupted by query cancel. However, that never actually worked, because in iterations after the first, we'd be holding buffer lock(s) w

pgsql: Refactor CHECK_FOR_INTERRUPTS() to add flexibility.

2021-05-14 Thread Tom Lane
Refactor CHECK_FOR_INTERRUPTS() to add flexibility. Split up CHECK_FOR_INTERRUPTS() to provide an additional macro INTERRUPTS_PENDING_CONDITION(), which just tests whether an interrupt is pending without attempting to service it. This is useful in situations where the caller knows that interrupts

pgsql: Fix query-cancel handling in spgdoinsert().

2021-05-14 Thread Tom Lane
Fix query-cancel handling in spgdoinsert(). Knowing that a buggy opclass could cause an infinite insertion loop, spgdoinsert() intended to allow its loop to be interrupted by query cancel. However, that never actually worked, because in iterations after the first, we'd be holding buffer lock(s) w

pgsql: Refactor CHECK_FOR_INTERRUPTS() to add flexibility.

2021-05-14 Thread Tom Lane
Refactor CHECK_FOR_INTERRUPTS() to add flexibility. Split up CHECK_FOR_INTERRUPTS() to provide an additional macro INTERRUPTS_PENDING_CONDITION(), which just tests whether an interrupt is pending without attempting to service it. This is useful in situations where the caller knows that interrupts

pgsql: Refactor CHECK_FOR_INTERRUPTS() to add flexibility.

2021-05-14 Thread Tom Lane
Refactor CHECK_FOR_INTERRUPTS() to add flexibility. Split up CHECK_FOR_INTERRUPTS() to provide an additional macro INTERRUPTS_PENDING_CONDITION(), which just tests whether an interrupt is pending without attempting to service it. This is useful in situations where the caller knows that interrupts

pgsql: Fix query-cancel handling in spgdoinsert().

2021-05-14 Thread Tom Lane
Fix query-cancel handling in spgdoinsert(). Knowing that a buggy opclass could cause an infinite insertion loop, spgdoinsert() intended to allow its loop to be interrupted by query cancel. However, that never actually worked, because in iterations after the first, we'd be holding buffer lock(s) w

pgsql: Describe (auto-)analyze behavior for partitioned tables

2021-05-14 Thread Alvaro Herrera
Describe (auto-)analyze behavior for partitioned tables This explains the new behavior introduced by 0827e8af70f4 as well as preexisting. Author: Justin Pryzby Author: Álvaro Herrera Discussion: https://postgr.es/m/20210423180152.ga17...@telsasoft.com Branch -- master Details --- http

pgsql: doc: update PG 14 release notes with recent feedback

2021-05-14 Thread Bruce Momjian
doc: update PG 14 release notes with recent feedback Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20210514020141.gq27...@telsasoft.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5eb1b27d20670b378508391fab01a6871a86a8e9 Modified Files --

pgsql: Message style improvements

2021-05-14 Thread Peter Eisentraut
Message style improvements Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/09ae329957b739dfbaf722eb5624d0a71fdff3b4 Modified Files -- src/bin/pg_dump/pg_dump.c| 4 ++-- src/bin/pg_rewind/pg_rewind.c| 2 +- src/interfaces/ecpg/pr