pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: David Steele <david@pgmasters.net>
Cc: Pavel Biryukov <79166341370@yandex.ru>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: posgres 12 bug (partitioned table)
Date: Wed, 21 Apr 2021 16:51:42 -0400
Message-ID: <801096.1619038302@sss.pgh.pa.us> (raw)
In-Reply-To: <20210421195904.kaa74iovl6okscjg@alap3.anarazel.de>
References: <81885.1597205290@sss.pgh.pa.us>
	<CA+HiwqFx8oBGTDmwVQNHQrSGw4we84E4z5J+q2zFRJeAt5BaCA@mail.gmail.com>
	<20200812162718.ycxrktzoe6rpdy5k@alap3.anarazel.de>
	<CA+HiwqEGgy8x5M2dotzH7HSd0v+byyJXGU8S+d5NFnrOBiTZDA@mail.gmail.com>
	<407111603806900@mail.yandex.ru>
	<CA+HiwqFjEim_RMCiaFxA4nUx00o3auXKPy-OsOcog+chg5K-zA@mail.gmail.com>
	<cd492dbd-a0ba-4790-bcf7-c4af2d2dc8d1@pgmasters.net>
	<CA+HiwqG7qhKJnFpZOqyrFngqcMzja+p=gssMK=73b+-BZffxqw@mail.gmail.com>
	<CA+HiwqHqnC=A9a+=F-k8J=JV-EKKt3vTgxq01=9af-0HE045NQ@mail.gmail.com>
	<793243.1619032209@sss.pgh.pa.us>
	<20210421195904.kaa74iovl6okscjg@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2021-04-21 15:10:09 -0400, Tom Lane wrote:
>> So now I'm thinking the right thing to be working on is banning access
>> to system columns via partition parent tables (other than tableoid,
>> which ought to work).

> And ctid, I assume? While I have some hope for generalizing the
> representation of tids at some point, I don't think it's realistic that
> we'd actually get rid of them anytime soon.

Hmm, I'd have thought that ctid would be very high on the list of
things we don't want to assume are the same for all AMs.  Admittedly,
refactoring that is going to be a large pain in the rear, but ...

I see that it actually works right now because slot_getsysattr
special-cases both tableoid and ctid, but I have a hard time
believing that that's a long-term answer.

> One could even imagine partition root specific system columns...

Yeah.  As I think about this, I recall a previous discussion where
we suggested that maybe partitioned tables could have a subset
of system columns, whereupon all their children would be required
to support (at least) those system columns.  But that would have
to be user-controllable, so a lot of infrastructure would need to
be built for it.  For the moment I'd be satisfied with a fixed
decision that only tableoid is treated that way.

> ISTM that the minimal changes needed would be to reorder sysattr.h to
> have TableOidAttributeNumber be -2 (and keep
> SelfItemPointerAttributeNumber as -1). And then slowly change all code
> to not reference FirstLowInvalidHeapAttributeNumber - which seems like a
> *substantial* amount of effort, due to all the shifting of AttrNumber by
> FirstLowInvalidHeapAttributeNumber to be able to represent system
> columns in bitmaps.

Getting rid of FirstLowInvalidHeapAttributeNumber seems like nearly
a nonstarter.  I'd be more inclined to reduce it by one or two so
as to leave some daylight for AMs that want system columns different
from the usual set.  I don't feel any urgency about renumbering the
existing columns --- the value of that vs. the risk of breaking
things doesn't seem like a great tradeoff.

			regards, tom lane





view thread (46+ messages)  latest in thread

Message-ID: <801096.1619038302@sss.pgh.pa.us>
Permalink:  ../801096.1619038302@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/801096.1619038302@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, amitlangote09@gmail.com, david@pgmasters.net, 79166341370@yandex.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: posgres 12 bug (partitioned table)
  In-Reply-To: <801096.1619038302@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox