Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-03-07 Thread Peter Eisentraut
On 03.03.24 11:02, Peter Eisentraut wrote: On 29.02.24 19:14, Tom Lane wrote: Peter Eisentraut 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

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-03-03 Thread Peter Eisentraut
On 29.02.24 19:14, Tom Lane wrote: Peter Eisentraut 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

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-29 Thread Tom Lane
Alvaro Herrera writes: > On 2024-Feb-29, Tom Lane wrote: >> I agree that perminfoindex seems to have suffered from add-at-the-end >> syndrome, and if we do touch the field order you made an improvement >> there. (BTW, who thought they needn't bother with a comment for >> perminfoindex?) > There

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-29 Thread Alvaro Herrera
On 2024-Feb-29, Tom Lane wrote: > I agree that perminfoindex seems to have suffered from add-at-the-end > syndrome, and if we do touch the field order you made an improvement > there. (BTW, who thought they needn't bother with a comment for > perminfoindex?) There is a comment for it, or at

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-29 Thread Tom Lane
Peter Eisentraut 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

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-29 Thread Peter Eisentraut
On 23.02.24 16:19, Tom Lane wrote: Dean Rasheed writes: On Fri, 23 Feb 2024 at 14:35, Peter Eisentraut wrote: Various code comments say that the RangeTblEntry field inh may only be set for entries of kind RTE_RELATION. Yes, it's explained a bit more clearly/accurately in

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-23 Thread Tom Lane
Dean Rasheed writes: > On Fri, 23 Feb 2024 at 14:35, Peter Eisentraut wrote: >> Various code comments say that the RangeTblEntry field inh may only be >> set for entries of kind RTE_RELATION. > Yes, it's explained a bit more clearly/accurately in > expand_inherited_rtentry(): > * "inh" is

Re: RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-23 Thread Dean Rasheed
On Fri, 23 Feb 2024 at 14:35, Peter Eisentraut wrote: > > Various code comments say that the RangeTblEntry field inh may only be > set for entries of kind RTE_RELATION. > > The function pull_up_simple_union_all() in prepjointree.c sets ->inh to > true for RTE_SUBQUERY entries: > > /* >

RangeTblEntry.inh vs. RTE_SUBQUERY

2024-02-23 Thread Peter Eisentraut
Various code comments say that the RangeTblEntry field inh may only be set for entries of kind RTE_RELATION. For example *inh is true for relation references that should be expanded to include *inheritance children, if the rel has any. This *must* be false for *RTEs other