Re: simple update on boolean

From: Cedric Boudin <cedric(at)dreamgnu(dot)com>
To: Cedric Boudin <cedric(at)dreamgnu(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: simple update on boolean
Date: 2007-12-06 12:38:31
Message-ID: 4757ED47.2010700@dreamgnu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cedric Boudin wrote:
> Most honourable members of the list,
>
> this is a simple one, but I can't find the solution ( probably a
> forest/tree problem).
>
> update table set bolean_column = set_it_to_its_inverse where fk =
> some_value;
>
> or join me in the dark forest
>
> cedric
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>
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.

Thks for bringing me the light in the forest.
working late isn't that effective !!!

cedric

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message SHARMILA JOTHIRAJAH 2007-12-06 12:51:23 Re: WAL shipping question
Previous Message Yancho 2007-12-06 12:16:14 Error in creating function