Re: BUG #15291: Lateral join has different/suprising semantics (with impure function) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15291: Lateral join has different/suprising semantics (with impure function)
Date
Msg-id 1235.1532440233@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15291: Lateral join has different/suprising semantics (withimpure function)  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> [ LATERAL is ignored when sub-select has no actual lateral references ]

> I can understand why it's happening what is happening, yet I still find it
> to be problematic. In my opinion those two selects should yield same
> results. Hence for impure functions lateral semantics should be preserved
> and not optimized away.

I believe this behavior is effectively required by the SQL spec.
In any case, removing it would pessimize many queries in which writing
an unnecessary LATERAL has no bad side-effects today, so I'm disinclined
to change a behavior that's stood for half a dozen releases now.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events
Next
From: Tom Lane
Date:
Subject: Re: BUG #15292: Multiple Messages "2018-07-24 10:46:12.566 CEST [32029] LOG: invalid length of startup" in logfile