pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aaron Bono <postgresql@aranya.com>
To: pgsql-sql@postgresql.org
Subject: Re: empty set
Date: Thu, 8 Jun 2006 23:47:16 -0500
Message-ID: <bf05e51c0606082147o41d5d4fdu2c69113464ae85aa@mail.gmail.com> (raw)
In-Reply-To: <1149802941.25526.279.camel@state.g2switchworks.com>
References: <20060608214012.96518.qmail@web37907.mail.mud.yahoo.com>
	<1149802941.25526.279.camel@state.g2switchworks.com>

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
>

view thread (5+ messages)  latest in thread

Message-ID: <bf05e51c0606082147o41d5d4fdu2c69113464ae85aa@mail.gmail.com>
Permalink:  ../bf05e51c0606082147o41d5d4fdu2c69113464ae85aa@mail.gmail.com/
Also on:    postgresql.org/message-id/bf05e51c0606082147o41d5d4fdu2c69113464ae85aa@mail.gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: postgresql@aranya.com
  Subject: Re: empty set
  In-Reply-To: <bf05e51c0606082147o41d5d4fdu2c69113464ae85aa@mail.gmail.com>

* 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