pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Ian Barwick <barwick@gmail.com>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Kenneth Gonsalves <lawgon@thenilgiris.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: replacing mysql enum
Date: 11 Dec 2004 12:25:50 -0500
Message-ID: <87llc44uht.fsf@stark.xeocode.com> (raw)
In-Reply-To: <1d581afe041211090628da57e@mail.gmail.com>
References: <04121110305520.21547@thenilgiris.com>
	<1d581afe04121104255557ea@mail.gmail.com>
	<20041211074227.J30051@megazone.bigpanda.com>
	<1d581afe041211090628da57e@mail.gmail.com>


Ian Barwick <barwick@gmail.com> writes:

> What I still don't quite understand is why IN in a CHECK context is
> handled differently to say: select 1 where 'x' in (null,'a','b','c') ?
> This could be a bit of a gotcha for anyone constructing a constraint
> similar to the original poster's and not realising it has no effect.

well

WHERE foo IN (null, ...)

returns null if foo isn't explicitly in the list (ie, "it may or may not equal
the unknown value in the list"). And I think constraints that return null are
deemed to have succeeded.

-- 
greg




view thread (9+ messages)  latest in thread

Message-ID: <87llc44uht.fsf@stark.xeocode.com>
Permalink:  ../87llc44uht.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87llc44uht.fsf@stark.xeocode.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: gsstark@mit.edu, barwick@gmail.com, sszabo@megazone.bigpanda.com, lawgon@thenilgiris.com
  Subject: Re: replacing mysql enum
  In-Reply-To: <87llc44uht.fsf@stark.xeocode.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