Re: transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, David Fetter <david(at)fetter(dot)org>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-owner(at)postgresql(dot)org, Kevin Grittner <kgrittn(at)gmail(dot)com>
Subject: Re: transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)
Date: 2017-05-10 11:10:07
Message-ID: CAEepm=2ZQ1CPGTYpW3NGY7bdjit4rdNKM2Mu_Rny78de4ZqNiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 10, 2017 at 3:55 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, May 9, 2017 at 11:48 PM, Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)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(at)gmail(dot)com> wrote:
> Hmm. What if the partitioning hierarchy contains foreign tables?

Arghalalkjhsdflg. Looking into that...

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

Attachment Content-Type Size
transition-tuples-from-child-tables-v3.patch application/octet-stream 39.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-05-10 12:02:16 Re: transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)
Previous Message Etsuro Fujita 2017-05-10 10:50:38 Re: Declarative partitioning - another take