On Mon, 23 Feb 2026 at 21:21, Peter Eisentraut <[email protected]> wrote:
> I read in the SQL standard that SELECT * in EXISTS is not supposed to be
> expanded to all columns, but only to an arbitrary literal.  This
> corresponds to the recommendation in the PostgreSQL documentation to
> write EXISTS (SELECT 1 ...) instead.  But not even our own tests and
> example code use that latter convention consistently, so I think many
> users don't know it or observe it either.  So implementing that little
> optimization for SELECT * seems reasonable.

> Thoughts?

Don't we already do this in simplify_EXISTS_query()?

David


Reply via email to