Re: [GENERAL] simple update on boolean

2007-12-06 Thread Obe, Regina
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ivan Sergio Borgonovo Sent: Thursday, December 06, 2007 10:19 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] simple update on boolean On Thu, 06 Dec 2007 14:53:13 +0100 Cedric Boudin <[EM

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Ivan Sergio Borgonovo
On Thu, 06 Dec 2007 14:53:13 +0100 Cedric Boudin <[EMAIL PROTECTED]> wrote: > > 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

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Cedric Boudin
Ivan Sergio Borgonovo wrote: > On Thu, 06 Dec 2007 13:38:31 +0100 > Cedric Boudin <[EMAIL PROTECTED]> 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; >> >>

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Ivan Sergio Borgonovo
On Thu, 06 Dec 2007 13:38:31 +0100 Cedric Boudin <[EMAIL PROTECTED]> 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

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Cedric Boudin
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 > > > ---

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Frank Millman
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; > I am usually a newbie around here, but this is one

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Daniel Drotos
On Thu, 6 Dec 2007, A. Kretschmer wrote: update table set bolean_column = set_it_to_its_inverse where fk = some_value; I've used: update table set bolean_column = not boolean_column where fk = some_value; which has worked for me well. Daniel ---(end of broadcast)---

Re: [GENERAL] simple update on boolean

2007-12-06 Thread A. Kretschmer
am Thu, dem 06.12.2007, um 10:25:26 +0100 mailte Cedric Boudin folgendes: > 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; test=

[GENERAL] simple update on boolean

2007-12-06 Thread Cedric Boudin
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)-