Re: parent foreign tables and row marks

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: parent foreign tables and row marks
Date: 2021-06-03 13:08:45
Message-ID: CA+HiwqE+Jcs7M=+sp_vmoCm6jMVzT7iUEFXO=TDtL5n1K2wO0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 3, 2021 at 10:07 AM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> On Thu, Jun 3, 2021 at 3:39 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> > > I noticed that 428b260f87e8 (v12) broke the cases where a parent
> > > foreign table has row marks assigned.
> >
> > Indeed :-(. Fix pushed. I tweaked the comments and test case slightly.
>
> Thank you.

Ah, I had forgotten to propose that we replace the following in the
preprocess_targetlist()'s row marks loop:

/* child rels use the same junk attrs as their parents */
if (rc->rti != rc->prti)
continue;

by an Assert as follows:

+ /* No child row marks yet. */
+ Assert (rc->rti == rc->prti);

I think the only place that sets prti that is != rti of a row mark is
expand_single_inheritance_child() and we can be sure that that
function now always runs after preprocess_targetlist() has run.
Attached a patch.

Thoughts?

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

Attachment Content-Type Size
no-child-rowmarks.patch application/octet-stream 550 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2021-06-03 13:15:59 Re: speed up verifying UTF-8
Previous Message Peter Eisentraut 2021-06-03 13:03:14 Re: Fixup some appendStringInfo and appendPQExpBuffer calls