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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: 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-03 15:47:04
Message-ID: CA+TgmoaLNydFcBytje=MS5yr9yeZpjD+feXt9ejrw7f8KcUkbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 2, 2017 at 9:44 PM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> I think that we should only capture transition tuples captured from
> the explicitly named relation, since we only fire AFTER STATEMENT
> triggers on that relation. I see no inconsistency with the policy of
> rejecting transition tables on partitioned tables (as I proposed and
> Kevin accepted[1]), because partitioned tables can't have any data so
> there would be no point. In contrast, every parent table in an
> inheritance hierarchy is also a regular table and can hold data, so I
> think we should allow transition tables on them, and capture
> transition tuples from that table only when you modify it directly.

I suspect that most users would find it more useful to capture all of
the rows that the statement actually touched, regardless of whether
they hit the named table or an inheritance child. I just don't know
if it's practical to make that work. (And, of course, I don't know if
other people agree with my assessment of what is useful ... but
generally there seems to be support for making partitioned tables, at
least, look more like a single table that happens to have partitions
and less like a bunch of separate tables attached to each other with
duct tape.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Kellerer 2017-05-03 15:51:46 Re: CTE inlining
Previous Message Alvaro Herrera 2017-05-03 15:18:01 Re: WITH clause in CREATE STATISTICS