Re: Null bind variable in where clause

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Chris Stuhr <cstuhr(at)ephibian(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Null bind variable in where clause
Date: 2007-05-01 14:51:00
Message-ID: 17166.1178031060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Dave Cramer <pg(at)fastcrypt(dot)com> writes:
> If you really want this behaviour then
> set
> transform_null_equals = off to on
> in postgresql.conf

Don't think that will help him --- that kluge just causes "foo = NULL"
to be translated to "foo IS NULL" *when the NULL is written as a
literal constant*. He seems to want a null passed through a parameter
symbol to be treated as a normal comparable value. The short answer
is that you can't do that in SQL; better rethink your usage of NULL,
because it hasn't got the behavior you want.

regards, tom lane

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Altaf Malik 2007-05-01 15:29:16 JDBC Default Encoding
Previous Message Mark Lewis 2007-05-01 14:10:16 Re: Null bind variable in where clause