From: Tom Lane <tgl@sss.pgh.pa.us>
To: kadek.marek@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15291: Lateral join has different/suprising semantics (with impure function)
Date: Tue, 24 Jul 2018 09:50:33 -0400
Message-ID: <1235.1532440233@sss.pgh.pa.us> (raw)
In-Reply-To: <153241622629.1395.7281368493830784815@wrigleys.postgresql.org>
References: <153241622629.1395.7281368493830784815@wrigleys.postgresql.org>
=?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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, kadek.marek@gmail.com
Subject: Re: BUG #15291: Lateral join has different/suprising semantics (with impure function)
In-Reply-To: <1235.1532440233@sss.pgh.pa.us>
References: <153241622629.1395.7281368493830784815@wrigleys.postgresql.org> <1235.1532440233@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox