Re: [SQL] nullif('','') on insert

2005-08-27 Thread Bruno Wolff III
> Your problem is that NULL's are typed in PostgreSQL. > > Try this: > > SELECT NULL; > SELECT NULL::BOOL; > SELECT NULL::BOOL::TEXT; > > to see what I mean. This is an exact illustration of your problem. Note that in 8.1 he will be able to do: SELECT NULL::TEXT::INT::BOOL and get the conversi

Re: [SQL] nullif('','') on insert

2005-08-26 Thread Chris Travers
Matt L. wrote: I need to test whether or not a value is null on insert. Example: insert into table (column) values nullif('','')); ERROR: column "column" is of type boolean but expression is of type text. Your problem is that NULL's are typed in PostgreSQL. Try this: SELECT NULL; SELECT

[SQL] nullif('','') on insert

2005-08-26 Thread Matt L.
I need to test whether or not a value is null on insert. Example: insert into table (column) values nullif('','')); ERROR: column "column" is of type boolean but expression is of type text. It works in MSSQL (probably against not standards) but nonetheless I need to make it work. I assume it's