pgsql: doc: Fix typo

2024-11-29 Thread Peter Eisentraut
doc: Fix typo for commit 1e08905842f Reported-by: Marcos Pegoraro Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/49ae9fd8b7081c075b74889449b29d47fd80eaf3 Modified Files -- doc/src/sgml/ddl.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-29 Thread Tom Lane
Richard Guo writes: > This patch can also simplify my other patch, which is to avoid > unnecessary wrapping for plain Vars/PHVs. We can check the new > nullingrel_info to see if the nullingrels of the subquery RTE are a > subset of the nullingrels of the lateral referenced rel, to determine > if

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-29 Thread Richard Guo
On Sat, Nov 30, 2024 at 6:31 AM Tom Lane wrote: > I wrote: > > The ideas I'd been toying with last night involved a pre-scan over > > the join tree to calculate the potential nullingrels of each leaf RTE > > (same idea as RelOptInfo.nulling_relids, but of course we don't have > > any RelOptInfos y

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-29 Thread Tom Lane
I wrote: > The ideas I'd been toying with last night involved a pre-scan over > the join tree to calculate the potential nullingrels of each leaf RTE > (same idea as RelOptInfo.nulling_relids, but of course we don't have > any RelOptInfos yet). That seems painful though because we'd have to > upda

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-29 Thread Tom Lane
Richard Guo writes: > I spent some time looking into this issue. Thanks for looking at it! > First of all, the lateral references cannot be outside of the lowest > outer join above the subquery; otherwise, is_simple_subquery() would > consider the subquery not eligible for pull-up. Yeah. While

pgsql: Small indenting fixes in jsonpath_scan.l

2024-11-29 Thread Peter Eisentraut
Small indenting fixes in jsonpath_scan.l Some lines were indented by an inconsistent number of spaces. While we're here, also fix some code that used the newline after left parenthesis style, which is obsolete. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5d39be

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-29 Thread Richard Guo
On Fri, Nov 29, 2024 at 10:44 AM Tom Lane wrote: > Richard Guo writes: > > On Fri, Nov 29, 2024 at 7:33 AM Tom Lane wrote: > >> It seems to be sufficient to just not mark lateral > >> references at all in this case. (I have a nagging feeling that more > >> complexity may be needed in cases wher