Re: BUG #1839: insert into table (column) values (nullif('',''));

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matt" <survivedsushi(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1839: insert into table (column) values (nullif('',''));
Date: 2005-08-22 15:26:36
Message-ID: 16159.1124724396@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Matt" <survivedsushi(at)yahoo(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jorg Heymans 2005-08-22 18:36:06 Re: importing 0xe3809c character, aka wave dash
Previous Message zeki 2005-08-22 15:19:05 Permission denied errors