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

From Bruce Momjian
Subject Re: Re: Does PostgreSQL support EXISTS?
Date
Msg-id 200106131538.f5DFc9v09998@candle.pha.pa.us
Whole thread Raw
In response to Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.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.

OK, so I wasn't missing anything in our current code.  I can see how
this capability would change things.

> 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.

Are we anywhere with optimizing IN to EXISTS?  I didn't think there was
any work being done in that area.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Re: [SQL] ORDER BY what?
Next
From: BELLON Michel
Date:
Subject: Compilation of contrib of postgresql 7.1.2 with cygwin 1.3.2