Re: empty set - Mailing list pgsql-sql

From Aaron Bono
Subject Re: empty set
Date
Msg-id bf05e51c0606082147o41d5d4fdu2c69113464ae85aa@mail.gmail.com
Whole thread Raw
In response to Re: empty set  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-sql
That will work if foo is never NULL.  If foo takes on a NULL value you will get those records where it is NULL.

Is there a reason you cannot do an if/else statement on the list size?  That is what I do on my queries.

-Aaron

On 6/8/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
On Thu, 2006-06-08 at 16:40, CG wrote:
> PostgreSQL 8.1
>
> I've been trying to write a SQL prepare routine. One of the challenging
> elements I'm running into is an empty set ...
>
> "select foo from bar where foo in ? ;"
>
> What if "?" is an set with zero elements? What is the proper value to use to
> replace "?" indicating an empty set?

NULL?

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


pgsql-sql by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: pgxml & xpath_table
Next
From: Bruno Wolff III
Date:
Subject: Re: empty set