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=3ibNsOtLA4z7Jd3css_NnduxORuSpP88q=7V_2c=A0Nw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)  (Robert Haas <robertmhaas@gmail.com>)
Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)  (Kevin Grittner <kgrittn@gmail.com>)
List pgsql-hackers
On Wed, May 10, 2017 at 11:10 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> 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.

Of course that's a bit crazy, not only for trigger authors to
understand and deal with, but also for plan caching: it just doesn't
really make sense to have a database object, even an ephemeral one,
whose type changes depending on how the trigger was invoked, because
the plans stick around.  Perhaps you could modify NamedTuplestorescan
to convert on the fly to the TupleDesc of the table that the row-level
trigger is attached to, using NULL for missing columns, but that'd be
a slightly strange too, depending on how you did it.

Perhaps we should reject row-level triggers with transition tables on
tables that are part of an inheritance hierarchy, but allow them for
partitions.

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



pgsql-hackers by date:

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