Re: BUG #14808: V10-beta4, backend abort

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Michael Paquier <michael.paquier@gmail.com>, Andrew Gierth <rhodiumtoad@postgresql.org>, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>, Kevin Grittner <kgrittn@gmail.com>
Date: 2017-09-13T22:44:02Z
Lists: pgsql-bugs
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> Aside from the RI case, the other user visible change in behaviour
> will be for statements that update the same table via multiple
> ModifyTable nodes (wCTEs).  Our regression test has:

> with wcte as (insert into table1 values (42))
>   insert into table2 values ('hello world');

> ... which demonstrates the fix for the original complaint that table1
> and table2 earlier tried to use the same transition table (and
> crashed).

BTW, as I'm digging around in trigger.c, I can't help noticing that
it provides a single "fdw_tuplestore" per trigger query level (a/k/a
trigger execution context).  I've not tried to test this, but it
sure looks like a wCTE like your example above, directed at two
separate foreign tables with triggers, would fail for exactly the
same reason.  That'd be a bug of pretty long standing.

			regards, tom lane


Commits

  1. Fix SQL-spec incompatibilities in new transition table feature.

  2. Quick-hack fix for foreign key cascade vs triggers with transition tables.

  3. Fix transition tables for ON CONFLICT.

  4. Fix transition tables for wCTEs.

  5. Repair problems occurring when multiple RI updates have to be done to the same