Re: posgres 12 bug (partitioned table) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: posgres 12 bug (partitioned table)
Date
Msg-id 398087.1597293352@sss.pgh.pa.us
Whole thread Raw
In response to Re: posgres 12 bug (partitioned table)  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-bugs
Amit Langote <amitlangote09@gmail.com> writes:
> On Thu, Aug 13, 2020 at 1:27 AM Andres Freund <andres@anarazel.de> wrote:
>> Hm? What are you referencing here?

> I meant that WITH <a-system-column> specified on a table presumably
> forces an AM to ensure that the column is present in its tuples, like
> WITH OIDS specification on a table would force heapam to initialize
> the oid system column in all tuples being inserted into that table.
> Lack of the same notation for other system columns means that AMs
> don't feel forced to ensure those columns are present in their tuples.

I might be missing some subtlety here, but it seems to me that a
given table AM will probably have a fixed set of system columns
that it provides.  For example heapam would provide exactly the
current set of columns, no matter what.  I'm imagining that
(1) if the parent partitioned table has column X, and the proposed
child-table AM doesn't provide that, then we just refuse to
create/attach the partition.
(2) if a child-table AM provides some system column that the
parent does not, then you can access that column when querying
the child table directly, but not when querying the parent.
This works just like extra child columns in traditional PG
inheritance.

Given these rules, an AM isn't expected to do anything conditional at
runtime: it just provides what it provides.  Instead we have an issue
to solve in or near the TupleTableSlot APIs, namely how to deal with
tuples that don't all have the same system columns.  But we'd have
that problem anyway.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: posgres 12 bug (partitioned table)
Next
From: Marco Cuccato
Date:
Subject: Re: BUG #16565: Systemd service file does not create /var/run/postgresql directory across reboot