Re: simple update on boolean

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: simple update on boolean
Date: 2007-12-06 13:06:55
Message-ID: 20071206140655.2f8c66fa@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 06 Dec 2007 13:38:31 +0100
Cedric Boudin <cedric(at)dreamgnu(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Usama Dar 2007-12-06 13:19:55 Re: how to redirect output to a file
Previous Message Alvaro Herrera 2007-12-06 13:03:16 Re: WAL shipping question