public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: David Steele <[email protected]>
Cc: Amit Langote <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Views no longer in rangeTabls?
Date: Fri, 09 Jun 2023 12:14:46 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CA+HiwqFC0xDCCiXbUjb-xisxo9PPuA8_ykn8Fz+6RbBJBE8mVA@mail.gmail.com>
<[email protected]>
David Steele <[email protected]> writes:
> Thank you, this was very helpful. I am able to get the expected result
> now with:
> /* We only care about tables/views and can ignore subqueries, etc. */
> if (!(rte->rtekind == RTE_RELATION ||
> (rte->rtekind == RTE_SUBQUERY && OidIsValid(rte->relid))))
> continue;
Right, that matches places like add_rtes_to_flat_rtable().
> One thing, though, rte->relkind is not set for views, so I still need to
> call get_rel_relkind(rte->relid). Not a big deal, but do you think it
> would make sense to set rte->relkind for views?
If you see "rte->rtekind == RTE_SUBQUERY && OidIsValid(rte->relid)",
it's dead certain that relid refers to a view, so you could just wire
in that knowledge.
regards, tom lane
view thread (3+ messages)
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Views no longer in rangeTabls?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox