Re: simple update on boolean - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: simple update on boolean
Date
Msg-id 20071206140655.2f8c66fa@webthatworks.it
Whole thread Raw
In response to Re: simple update on boolean  (Cedric Boudin <cedric@dreamgnu.com>)
Responses Re: simple update on boolean
List pgsql-general
On Thu, 06 Dec 2007 13:38:31 +0100
Cedric Boudin <cedric@dreamgnu.com> wrote:

> It was indeed a forest problem.
> both:
>
> set bolean_column= not bolean_column
> and
> set bolean_column= case when bolean_column then 'f'::bool else
> 't'::bool end;
>
> do work perfectly.

What if boolean_column is NULL?

btw set bolean_column= not bolean_column works "as expected".

template1=# select (not 't'::boolean),(not 'f'::boolean),(not
NULL::boolean);

?column? | ?column? | ?column?
----------+----------+----------
 f        | t        |
(1 riga)


--
Ivan Sergio Borgonovo
http://www.webthatworks.it


pgsql-general by date:

Previous
From: SHARMILA JOTHIRAJAH
Date:
Subject: Re: WAL shipping question
Next
From: Alvaro Herrera
Date:
Subject: Re: WAL shipping question