Re: [GENERAL] Checking inequality

2004-12-11 Thread Michael Fuhr
On Sat, Dec 11, 2004 at 08:54:40AM -0800, Stephan Szabo wrote: > old.series_id IS DISTINCT FROM new.series_id may do what you want > depending on how you want NULLs to compare (IS DISTINCT FROM would be > false). I forgot about IS DISTINCT FROM. I like that better than using COALESCE, as I had s

Re: [GENERAL] Checking inequality

2004-12-11 Thread Vitaly Belman
True. It does seem more proper. Thanks. On Sat, 11 Dec 2004 10:57:25 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Sat, Dec 11, 2004 at 08:54:40AM -0800, Stephan Szabo wrote: > > > old.series_id IS DISTINCT FROM new.series_id may do what you want > > depending on how you want NULLs to comp

Re: [GENERAL] Checking inequality

2004-12-11 Thread Tom Lane
Vitaly Belman <[EMAIL PROTECTED]> writes: > What can I do to check inequality even in the case that old or new > series_id is NULL? Try IS DISTINCT FROM. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our

Re: [GENERAL] Checking inequality

2004-12-11 Thread Stephan Szabo
On Sat, 11 Dec 2004, Vitaly Belman wrote: > I have the following code in one of my trigger functions > > --- > IF old.series_id<>new.series_id THEN > ... > ... > END IF; > --- >

Re: [GENERAL] Checking inequality

2004-12-11 Thread Vitaly Belman
COALESCE is good enough for me. Thanks. On Sat, 11 Dec 2004 09:33:32 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Sat, Dec 11, 2004 at 02:42:21PM +0200, Vitaly Belman wrote: > > > IF old.series_id<>new.series_id THEN > > ... > > The problem is that series_id can change to be NULL in which

Re: [GENERAL] Checking inequality

2004-12-11 Thread Michael Fuhr
On Sat, Dec 11, 2004 at 02:42:21PM +0200, Vitaly Belman wrote: > IF old.series_id<>new.series_id THEN > ... > The problem is that series_id can change to be NULL in which case I > have problems as "NULL <> 7" doesn't return "true". > > What can I do to check inequality even in the case that old o

[GENERAL] Checking inequality

2004-12-11 Thread Vitaly Belman
I have the following code in one of my trigger functions --- IF old.series_id<>new.series_id THEN ... ... END IF; --- The problem is that series_id can change to be NULL in whic