Re: posgres 12 bug (partitioned table)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Pavel Biryukov <79166341370(at)yandex(dot)ru>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: posgres 12 bug (partitioned table)
Date: 2020-08-13 04:35:52
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> On Thu, Aug 13, 2020 at 1:27 AM Andres Freund <andres(at)anarazel(dot)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

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Marco Cuccato 2020-08-13 07:17:39 Re: BUG #16565: Systemd service file does not create /var/run/postgresql directory across reboot
Previous Message Amit Langote 2020-08-13 04:13:18 Re: posgres 12 bug (partitioned table)

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-08-13 04:38:05 REINDEX SCHEMA/DATABASE/SYSTEM weak with dropped relations
Previous Message Mikhail Titov 2020-08-13 04:30:50 [bug+patch] Inserting DEFAULT into generated columns from VALUES RTE