Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take) - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)
Date
Msg-id CAEepm=2ZQ1CPGTYpW3NGY7bdjit4rdNKM2Mu_Rny78de4ZqNiA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
On Wed, May 10, 2017 at 3:55 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, May 9, 2017 at 11:48 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> Hmm.  DB2 has transition tables (invented them maybe?) and it allows
>> OLD/NEW TABLE on row-level triggers:
>>
>> https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/t0020236.html
>
> Yeah, my impression is that Kevin was pretty keen on supporting that
> case.  I couldn't say exactly why, though.

Ok, here's a new version that handles row-level triggers with
transition tables on any child table.  The regression tests show
partition and inheritance examples of that.  To be clear about what
this does:

1.  If you attach a row-level trigger with transition tables to any
partition, it will see transition tuples from all partitions that were
modified by the same statement.

2.  If you attach a row-level trigger with transition tables to any
inheritance child, it will see transition tuples from all tables in
the inheritance hierarchy at or below the directly named table that
were modified by the same statement, sliced so that they appear as
tuples from the directly named table.

On Wed, May 10, 2017 at 3:41 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> Hmm.  What if the partitioning hierarchy contains foreign tables?

Arghalalkjhsdflg.  Looking into that...

-- 
Thomas Munro
http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: [HACKERS] Declarative partitioning - another take
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)