pgsql: Force NO SCROLL for plpgsql's implicit cursors.

2021-06-08 Thread Tom Lane
Force NO SCROLL for plpgsql's implicit cursors. Further thought about bug #17050 suggests that it's a good idea to use CURSOR_OPT_NO_SCROLL for the implicit cursor opened by a plpgsql FOR-over-query loop. This ensures that, if somebody commits inside the loop, PersistHoldablePortal won't try to r

pgsql: Force NO SCROLL for plpgsql's implicit cursors.

2021-06-08 Thread Tom Lane
Force NO SCROLL for plpgsql's implicit cursors. Further thought about bug #17050 suggests that it's a good idea to use CURSOR_OPT_NO_SCROLL for the implicit cursor opened by a plpgsql FOR-over-query loop. This ensures that, if somebody commits inside the loop, PersistHoldablePortal won't try to r

pgsql: Force NO SCROLL for plpgsql's implicit cursors.

2021-06-08 Thread Tom Lane
Force NO SCROLL for plpgsql's implicit cursors. Further thought about bug #17050 suggests that it's a good idea to use CURSOR_OPT_NO_SCROLL for the implicit cursor opened by a plpgsql FOR-over-query loop. This ensures that, if somebody commits inside the loop, PersistHoldablePortal won't try to r

pgsql: Force NO SCROLL for plpgsql's implicit cursors.

2021-06-08 Thread Tom Lane
Force NO SCROLL for plpgsql's implicit cursors. Further thought about bug #17050 suggests that it's a good idea to use CURSOR_OPT_NO_SCROLL for the implicit cursor opened by a plpgsql FOR-over-query loop. This ensures that, if somebody commits inside the loop, PersistHoldablePortal won't try to r

pgsql: Avoid misbehavior when persisting a non-stable cursor.

2021-06-08 Thread Tom Lane
Avoid misbehavior when persisting a non-stable cursor. PersistHoldablePortal has long assumed that it should store the entire output of the query-to-be-persisted, which requires rewinding and re-reading the output. This is problematic if the query is not stable: we might get different row content

pgsql: Avoid misbehavior when persisting a non-stable cursor.

2021-06-08 Thread Tom Lane
Avoid misbehavior when persisting a non-stable cursor. PersistHoldablePortal has long assumed that it should store the entire output of the query-to-be-persisted, which requires rewinding and re-reading the output. This is problematic if the query is not stable: we might get different row content

pgsql: Avoid misbehavior when persisting a non-stable cursor.

2021-06-08 Thread Tom Lane
Avoid misbehavior when persisting a non-stable cursor. PersistHoldablePortal has long assumed that it should store the entire output of the query-to-be-persisted, which requires rewinding and re-reading the output. This is problematic if the query is not stable: we might get different row content

pgsql: Avoid misbehavior when persisting a non-stable cursor.

2021-06-08 Thread Tom Lane
Avoid misbehavior when persisting a non-stable cursor. PersistHoldablePortal has long assumed that it should store the entire output of the query-to-be-persisted, which requires rewinding and re-reading the output. This is problematic if the query is not stable: we might get different row content

pgsql: doc: update release note item about the v2 wire protocol

2021-06-08 Thread Bruce Momjian
doc: update release note item about the v2 wire protocol Protocol v2 was last used in PG 7.3, not 7.2. Reported-by: Tatsuo Ishii Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdi

pgsql: Adjust batch size in postgres_fdw to not use too many parameters

2021-06-08 Thread Tomas Vondra
Adjust batch size in postgres_fdw to not use too many parameters The FE/BE protocol identifies parameters with an Int16 index, which limits the maximum number of parameters per query to 65535. With batching added to postges_fdw this limit is much easier to hit, as the whole batch is essentially a

pgsql: Fix pg_visibility regression failure with CLOBBER_CACHE_ALWAYS

2021-06-08 Thread Tomas Vondra
Fix pg_visibility regression failure with CLOBBER_CACHE_ALWAYS Commit 8e03eb92e9 reverted a bit too much code, reintroducing one of the issues fixed by 39b66a91bd - a page might have been left partially empty after relcache invalidation. Reported-By: Tom Lane Author: Masahiko Sawada Discussion: h

pgsql: Don't crash on empty statements in SQL-standard function bodies.

2021-06-08 Thread Tom Lane
Don't crash on empty statements in SQL-standard function bodies. gram.y should discard NULL pointers (empty statements) when assembling a routine_body_stmt_list, as it does for other sorts of statement lists. Julien Rouhaud and Tom Lane, per report from Noah Misch. Discussion: https://postgr.es/

pgsql: Fix contrib/seg regression test in v11.

2021-06-08 Thread Tom Lane
Fix contrib/seg regression test in v11. In 20e36c6d2, I neglected to update seg_1.out (which doesn't exist in newer branches). Per buildfarm, via Andrew Dunstan. Discussion: https://postgr.es/m/[email protected] Branch -- REL_11_STABLE Details --- https

pgsql: libpq: Fix SNI host handling

2021-06-08 Thread Peter Eisentraut
libpq: Fix SNI host handling Fix handling of NULL host name (possibly by using hostaddr). It previously crashed. Also, we should look at connhost, not pghost, to handle multi-host specifications. Also remove an unnecessary SSL_CTX_free(). Reported-by: Jacob Champion Reviewed-by: Michael Paqui

Re: pgsql: Stabilize contrib/seg regression test.

2021-06-08 Thread Tom Lane
Andrew Dunstan writes: > Looks like you forgot seg_1.out So I did :-( ... will fix in a bit. regards, tom lane

Re: pgsql: Stabilize contrib/seg regression test.

2021-06-08 Thread Andrew Dunstan
On 6/7/21 2:53 PM, Tom Lane wrote: > Stabilize contrib/seg regression test. > > If autovacuum comes along just after we fill table test_seg with > some data, it will update the stats to the point where we prefer > a plain indexscan over a bitmap scan, breaking the expected > output (as well as th