Re: Re: Does PostgreSQL support EXISTS? - Mailing list pgsql-general

From Tom Lane
Subject Re: Re: Does PostgreSQL support EXISTS?
Date
Msg-id 26506.992445998@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: Does PostgreSQL support EXISTS?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Re: Does PostgreSQL support EXISTS?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Got it.  How does an IN subquery returning NULL behave differently from
> one returning FALSE?  I can't think of a test that would be affected.

After we fix IS TRUE and friends to respond to nulls correctly (Conway's
promised to do that, IIRC) it'll be possible to write

    (foo IN (SELECT ...)) IS NOT FALSE

and get the "intuitive" behavior.  But right now that doesn't work.

Hm.  Maybe we could recognize that construct as a whole, and translate
it to an optimizable join?  It'd become the usual locution, I imagine.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: Does PostgreSQL support EXISTS?
Next
From: Lamar Owen
Date:
Subject: Re: Re: [SQL] ORDER BY what?