public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Tom Lane <[email protected]>
Cc: Dean Rasheed <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: RangeTblEntry.inh vs. RTE_SUBQUERY
Date: Sun, 3 Mar 2024 11:02:48 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAEZATCXZP9dd4oym=nLzkHswjfBcY6-Xe4RH+v+YLC0jiKR30Q@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>

On 29.02.24 19:14, Tom Lane wrote:
> Peter Eisentraut <[email protected]> writes:
>> In nodes/parsenodes.h, it says both
>>       This *must* be false for RTEs other than RTE_RELATION entries.
> 
> Well, that's true in the parser ...
> 
>> and also puts it under
>>       Fields valid in all RTEs:
>> which are both wrong on opposite ends of the spectrum.
>> I think it would make more sense to group inh under "Fields valid for a
>> plain relation RTE" and then explain the exception for subqueries, like
>> it is done for several other fields.
> 
> Dunno.  The adjacent "lateral" field is also used for only selected
> RTE kinds.

The section is

     /*
      * Fields valid in all RTEs:
      */
     Alias      *alias;          /* user-written alias clause, if any */
     Alias      *eref;           /* expanded reference names */
     bool        lateral;        /* subquery, function, or values is 
LATERAL? */
     bool        inh;            /* inheritance requested? */
     bool        inFromCl;       /* present in FROM clause? */
     List       *securityQuals;  /* security barrier quals to apply, if 
any */

According to my testing, lateral is used for RTE_RELATION, RTE_SUBQUERY, 
RTE_FUNCTION, RTE_TABLEFUNC, RTE_VALUES, which is 5 out of 9 possible. 
So I think it might be okay to relabel that section (in actuality or 
mentally) as "valid in several/many/most RTEs".

But I'm not sure what reason there would be for having inh there, which 
is better described as "valid for RTE_RELATION, but also borrowed by 
RTE_SUBQUERY", which is pretty much exactly what is the case for relid, 
relkind, etc.







view thread (3+ messages)  latest in thread

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: RangeTblEntry.inh vs. RTE_SUBQUERY
  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