[COMMITTERS] pgsql: Fix bogus size calculation introduced by commit cc5f81366.

2017-09-17 Thread Tom Lane
Fix bogus size calculation introduced by commit cc5f81366. The elements of RecordCacheArray are TupleDesc, not TupleDesc *. Those are actually the same size, so that this error is harmless, but it's still wrong --- and it might bite us someday, if TupleDesc ever became a struct, say. Per Coverity

[COMMITTERS] pgsql: Ensure that BEFORE STATEMENT triggers fire the right number of t

2017-09-17 Thread Tom Lane
Ensure that BEFORE STATEMENT triggers fire the right number of times. Commit 0f79440fb introduced mechanism to keep AFTER STATEMENT triggers from firing more than once per statement, which was formerly possible if more than one FK enforcement action had to be applied to a given table. Add a simil

[COMMITTERS] pgsql: Ensure that BEFORE STATEMENT triggers fire the right number of t

2017-09-17 Thread Tom Lane
Ensure that BEFORE STATEMENT triggers fire the right number of times. Commit 0f79440fb introduced mechanism to keep AFTER STATEMENT triggers from firing more than once per statement, which was formerly possible if more than one FK enforcement action had to be applied to a given table. Add a simil

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Fix possible dangling pointer dereference in trigger.c.

2017-09-17 Thread Tom Lane
Fix possible dangling pointer dereference in trigger.c. AfterTriggerEndQuery correctly notes that the query_stack could get repalloc'd during a trigger firing, but it nonetheless passes the address of a query_stack entry to afterTriggerInvokeEvents, so that if such a repalloc occurs, afterTriggerI

[COMMITTERS] pgsql: Allow rel_is_distinct_for() to look through RelabelType below Op

2017-09-17 Thread Tom Lane
Allow rel_is_distinct_for() to look through RelabelType below OpExpr. This lets it do the right thing for, eg, varchar columns. Back-patch to 9.5 where this logic appeared. David Rowley, per report from Kim Rose Carlsen Discussion: https://postgr.es/m/vi1pr05mb17091f9a9876528055d6a827c7...@vi1p

[COMMITTERS] pgsql: Allow rel_is_distinct_for() to look through RelabelType below Op

2017-09-17 Thread Tom Lane
Allow rel_is_distinct_for() to look through RelabelType below OpExpr. This lets it do the right thing for, eg, varchar columns. Back-patch to 9.5 where this logic appeared. David Rowley, per report from Kim Rose Carlsen Discussion: https://postgr.es/m/vi1pr05mb17091f9a9876528055d6a827c7...@vi1p

[COMMITTERS] pgsql: Allow rel_is_distinct_for() to look through RelabelType below Op

2017-09-17 Thread Tom Lane
Allow rel_is_distinct_for() to look through RelabelType below OpExpr. This lets it do the right thing for, eg, varchar columns. Back-patch to 9.5 where this logic appeared. David Rowley, per report from Kim Rose Carlsen Discussion: https://postgr.es/m/vi1pr05mb17091f9a9876528055d6a827c7...@vi1p

[COMMITTERS] pgsql: Allow rel_is_distinct_for() to look through RelabelType below Op

2017-09-17 Thread Tom Lane
Allow rel_is_distinct_for() to look through RelabelType below OpExpr. This lets it do the right thing for, eg, varchar columns. Back-patch to 9.5 where this logic appeared. David Rowley, per report from Kim Rose Carlsen Discussion: https://postgr.es/m/vi1pr05mb17091f9a9876528055d6a827c7...@vi1p

[COMMITTERS] pgsql: Doc: update v10 release notes through today.

2017-09-17 Thread Tom Lane
Doc: update v10 release notes through today. Add item about number of times statement-level triggers will be fired. Rearrange the compatibility items into (what seems to me) a less random ordering. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/90cebfa9ee3a4

[COMMITTERS] pgsql: Doc: update v10 release notes through today.

2017-09-17 Thread Tom Lane
Doc: update v10 release notes through today. Add item about number of times statement-level triggers will be fired. Rearrange the compatibility items into (what seems to me) a less random ordering. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/68ab9acd8557a9401a11

Re: [COMMITTERS] pgsql: Fix bogus size calculation introduced by commit cc5f81366.

2017-09-17 Thread Thomas Munro
On Mon, Sep 18, 2017 at 3:35 AM, Tom Lane wrote: > Fix bogus size calculation introduced by commit cc5f81366. > > The elements of RecordCacheArray are TupleDesc, not TupleDesc *. > Those are actually the same size, so that this error is harmless, > but it's still wrong --- and it might bite us som

Re: [COMMITTERS] pgsql: Fix transient mdsync() errors of truncated relations due to 72a9

2017-09-17 Thread Peter Geoghegan
On Wed, May 4, 2016 at 1:59 AM, Andres Freund wrote: > The cleanest fix seems to be to allow the caller of _mdfd_getseg() to > specify whether checks for RELSEG_SIZE are performed. To allow doing so, > change the ExtensionBehavior enum into a bitmask. Besides allowing for > the addition of EXTENSI

Re: [COMMITTERS] pgsql: Fix bogus size calculation introduced by commit cc5f81366.

2017-09-17 Thread Michael Paquier
On Mon, Sep 18, 2017 at 6:58 AM, Thomas Munro wrote: > While googling around trying to find where I could read Coverity's > output myself I was intrigued to see that https://scan.coverity.com > offers integration with Travis CI[1], which suggests the possibility > of automatically scanning all Com

[COMMITTERS] pgsql: Fix DROP SUBSCRIPTION hang

2017-09-17 Thread Peter Eisentraut
Fix DROP SUBSCRIPTION hang When ALTER SUBSCRIPTION DISABLE is run in the same transaction before DROP SUBSCRIPTION, the latter will hang because workers will still be running, not having seen the DISABLE committed, and DROP SUBSCRIPTION will wait until the workers have vacated the replication orig

[COMMITTERS] pgsql: Fix DROP SUBSCRIPTION hang

2017-09-17 Thread Peter Eisentraut
Fix DROP SUBSCRIPTION hang When ALTER SUBSCRIPTION DISABLE is run in the same transaction before DROP SUBSCRIPTION, the latter will hang because workers will still be running, not having seen the DISABLE committed, and DROP SUBSCRIPTION will wait until the workers have vacated the replication orig