Re: posgres 12 bug (partitioned table)

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Pavel Biryukov <79166341370(at)yandex(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: posgres 12 bug (partitioned table)
Date: 2021-03-12 12:47:18
Message-ID: CA+HiwqHqnC=A9a+=F-k8J=JV-EKKt3vTgxq01=9af-0HE045NQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Sorry for the noise to everyone who will see the below reply a 2nd
time, but doing...

On Fri, Mar 12, 2021 at 7:16 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> (adding -hackers)

..this is in violation of list rules which I should've known. So I'm
re-replying after removing -hackers.

> On Sat, Mar 6, 2021 at 1:25 AM David Steele <david(at)pgmasters(dot)net> wrote:
> > On 10/28/20 10:01 AM, Amit Langote wrote:
> > > On Tue, Oct 27, 2020 at 10:55 PM Pavel Biryukov <79166341370(at)yandex(dot)ru> wrote:
> > >> Hi!
> > >>
> > >> What's the state with this issue?
> > > I think that the patch that Andres Freund posted earlier on this
> > > thread [1] would be fine as a workaround at least for stable releases
> > > v12 and v13. I have attached with this email a rebased version of
> > > that patch, although I also made a few changes. The idea of the patch
> > > is to allocate and use a partition-specific *non-virtual* slot, one
> > > that is capable of providing system columns when the RETURNING
> > > projection needs them. Andres' patch would allocate such a slot even
> > > if RETURNING contained no system columns, whereas I changed the slot
> > > creation code stanza to also check that RETURNING indeed contains
> > > system columns. I've attached 2 patch files: one for HEAD and another
> > > for v12 and v13 branches.
> > >
> > > That said, the discussion on what to do going forward to *cleanly*
> > > support accessing system columns through partitioned tables is
> > > pending, but maybe the "workaround" fix will be enough in the meantime
> > > (at least v12 and v13 can only get a workaround fix).
> > > stgresql.org/message-id/20200811180629.zx57llliqcmcgfyr%40alap3.anarazel.de
> >
> > This thread has been quiet for while.
>
> Sorry David, I'm a week late myself in noticing this reminder.
>
> > Does everyone agree with Amit's
> > proposal to use this patch as a workaround?
>
> I'm attaching an updated version of the patches with a commit message
> this time. Two files like before -- one that applies to both v12 and
> v13 and another to the master branch.
>
> > Also, is there a CF entry for this issue? If so I am unable to find it.
>
> Unfortunately, I never created one.

Patches as described above are attached again.

Forgot to ask in the last reply: for HEAD, should we consider simply
preventing accessing system columns when querying through a parent
partitioned table, as was also mentioned upthread?

--
Amit Langote
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v3-0001-Fix-RETURNING-system-columns-when-inserting-into-_BACKPATCH_v12_13.patch application/octet-stream 7.2 KB
v3-0001-Fix-RETURNING-system-columns-when-inserting-into-_HEAD.patch application/octet-stream 7.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2021-03-12 12:59:14 Re: BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties
Previous Message Juan José Santamaría Flecha 2021-03-12 11:12:43 Re: BUG #16920: Can't compile PostGIS with MingW64 against PostgreSQL 14 head

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2021-03-12 13:14:13 Re: [POC] verifying UTF-8 using SIMD instructions
Previous Message Matthias van de Meent 2021-03-12 12:45:38 Re: non-HOT update not looking at FSM for large tuple update