Re: parent foreign tables and row marks - Mailing list pgsql-hackers

From Amit Langote
Subject Re: parent foreign tables and row marks
Date
Msg-id CA+HiwqE+Jcs7M=+sp_vmoCm6jMVzT7iUEFXO=TDtL5n1K2wO0w@mail.gmail.com
Whole thread Raw
In response to Re: parent foreign tables and row marks  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
On Thu, Jun 3, 2021 at 10:07 AM Amit Langote <amitlangote09@gmail.com> wrote:
> On Thu, Jun 3, 2021 at 3:39 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >
> > Amit Langote <amitlangote09@gmail.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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Fixup some appendStringInfo and appendPQExpBuffer calls
Next
From: Heikki Linnakangas
Date:
Subject: Re: speed up verifying UTF-8