Re: BUG #1839: insert into table (column) values (nullif('','')); - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1839: insert into table (column) values (nullif('',''));
Date
Msg-id 16159.1124724396@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1839: insert into table (column) values (nullif('',''));  ("Matt" <survivedsushi@yahoo.com>)
List pgsql-bugs
"Matt" <survivedsushi@yahoo.com> writes:
> insert into table (column) values (nullif('',''));
> ERROR: column "column" is of type boolean but
> expression is of type text.

Seems reasonable to me.  What type would you expect '' to be?

> It works in MSSQL.

If you think silent conversions from text to boolean are a good idea,
use MSSQL.  (Or create a cast to make PG do it ... but implicit
conversions across datatype categories are generally a bad idea in
my experience.  They tend to fire in cases where you didn't expect it.)

            regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #1839: insert into table (column) values (nullif('',''));
Next
From: Jorg Heymans
Date:
Subject: Re: importing 0xe3809c character, aka wave dash