pgsql: Remove _configthreadlocale() calls in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove _configthreadlocale() calls in ecpg test suite. This essentially reverts commits a772624b1 and 04fbe0e45, which added "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)" calls to the thread-related ecpg test programs. That was nothing but a hack, because we shouldn't expect that ecpg-using ap

pgsql: Remove infinite-loop hazards in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove infinite-loop hazards in ecpg test suite. A report from Andrew Dunstan showed that an ecpglib breakage that causes repeated query failures could lead to infinite loops in some ecpg test scripts, because they contain "while(1)" loops with no exit condition other than successful test completi

pgsql: Remove infinite-loop hazards in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove infinite-loop hazards in ecpg test suite. A report from Andrew Dunstan showed that an ecpglib breakage that causes repeated query failures could lead to infinite loops in some ecpg test scripts, because they contain "while(1)" loops with no exit condition other than successful test completi

pgsql: Remove infinite-loop hazards in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove infinite-loop hazards in ecpg test suite. A report from Andrew Dunstan showed that an ecpglib breakage that causes repeated query failures could lead to infinite loops in some ecpg test scripts, because they contain "while(1)" loops with no exit condition other than successful test completi

pgsql: Remove infinite-loop hazards in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove infinite-loop hazards in ecpg test suite. A report from Andrew Dunstan showed that an ecpglib breakage that causes repeated query failures could lead to infinite loops in some ecpg test scripts, because they contain "while(1)" loops with no exit condition other than successful test completi

pgsql: Remove infinite-loop hazards in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove infinite-loop hazards in ecpg test suite. A report from Andrew Dunstan showed that an ecpglib breakage that causes repeated query failures could lead to infinite loops in some ecpg test scripts, because they contain "while(1)" loops with no exit condition other than successful test completi

pgsql: Remove infinite-loop hazards in ecpg test suite.

2019-01-24 Thread Tom Lane
Remove infinite-loop hazards in ecpg test suite. A report from Andrew Dunstan showed that an ecpglib breakage that causes repeated query failures could lead to infinite loops in some ecpg test scripts, because they contain "while(1)" loops with no exit condition other than successful test completi

pgsql: PL/pgSQL: Add statement ID to statement structures

2019-01-24 Thread Peter Eisentraut
PL/pgSQL: Add statement ID to statement structures This can be used by a profiler as the index for an array of per-statement metrics. Author: Pavel Stehule Reviewed-by: Peter Eisentraut Discussion: https://www.postgresql.org/message-id/flat/CAFj8pRDRCjN6rpM9ZccU7Ta_afsNX7mg9=n34f+r445nt9v...@m

pgsql: Fix whitespace

2019-01-24 Thread Peter Eisentraut
Fix whitespace Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bf2fb2e03ebd897575d7428c73ae6ba7b1f91fc7 Modified Files -- src/bin/pg_upgrade/function.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-)

pgsql: Fix droppability of constraints upon partition detach

2019-01-24 Thread Alvaro Herrera
Fix droppability of constraints upon partition detach We were failing to set conislocal correctly for constraints in partitions after partition detach, leading to those constraints becoming undroppable. Fix by setting the flag correctly. Existing databases might contain constraints with the coni

pgsql: Fix droppability of constraints upon partition detach

2019-01-24 Thread Alvaro Herrera
Fix droppability of constraints upon partition detach We were failing to set conislocal correctly for constraints in partitions after partition detach, leading to those constraints becoming undroppable. Fix by setting the flag correctly. Existing databases might contain constraints with the coni

pgsql: Fix portability problem in pgbench.

2019-01-24 Thread Tom Lane
Fix portability problem in pgbench. The pgbench regression test supposed that srandom() with a specific value would result in deterministic output from random(), as required by POSIX. It emerges however that OpenBSD is too smart to be constrained by mere standards, so their random() emits nondeter

pgsql: Fix portability problem in pgbench.

2019-01-24 Thread Tom Lane
Fix portability problem in pgbench. The pgbench regression test supposed that srandom() with a specific value would result in deterministic output from random(), as required by POSIX. It emerges however that OpenBSD is too smart to be constrained by mere standards, so their random() emits nondeter

Re: pgsql: Detach constraints when partitions are detached

2019-01-24 Thread Alvaro Herrera
CC'ing -hackers. On 2019-Jan-24, Amit Langote wrote: > On 2019/01/24 13:58, Tom Lane wrote: > > Alvaro Herrera writes: > >> Detach constraints when partitions are detached > > > > Hm ... it looks like this fails under -DRELCACHE_FORCE_RELEASE: > > Oops, sorry. This is why: > > index

pgsql: Simplify coding to detach constraints when detaching partition

2019-01-24 Thread Alvaro Herrera
Simplify coding to detach constraints when detaching partition The original coding was too baroque and led to an use-after-release mistake, noticed by buildfarm member prion. Discussion: https://postgr.es/m/21693.1548305...@sss.pgh.pa.us Branch -- REL_11_STABLE Details --- https://git.p

pgsql: Simplify coding to detach constraints when detaching partition

2019-01-24 Thread Alvaro Herrera
Simplify coding to detach constraints when detaching partition The original coding was too baroque and led to an use-after-release mistake, noticed by buildfarm member prion. Discussion: https://postgr.es/m/21693.1548305...@sss.pgh.pa.us Branch -- master Details --- https://git.postgres