Re: Making Vars outer-join aware

From: "Anton A(dot) Melnikov" <aamelnikov(at)inbox(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "Finnerty, Jim" <jfinnert(at)amazon(dot)com>
Subject: Re: Making Vars outer-join aware
Date: 2023-07-23 12:20:21
Message-ID: ef91a47a-e189-e881-d3ec-913096ca1719@inbox.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08.06.2023 19:58, Tom Lane wrote:
> I think the right thing here is not either of your patches, but
> to tweak adjust_relid_set() to not fail on negative oldrelid.
> I'll go make it so.

Thanks! This fully solves the problem with ChangeVarNodes() that i wrote above.

> Hmm. That implies that you're changing plan data structures around after
> setrefs.c, which doesn't seem like a great design to me --- IMO that ought
> to happen in PlanCustomPath, which will still see the original varnos.

My further searchers led to the fact that it is possible to immediately set the
necessary varnos during custom_scan->scan.plan.targetlist creation and leave the
сustom_scan->custom_scan_tlist = NIL rather than changing them later using ChangeVarNodes().
This resulted in a noticeable code simplification.
Thanks a lot for pointing on it!

Sincerely yours,

--
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ahmed Ibrahim 2023-07-23 13:08:53 Re: There should be a way to use the force flag when restoring databases
Previous Message Tomas Vondra 2023-07-23 12:04:18 Re: Use of additional index columns in rows filtering