Re: casting from integer to boolean - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: casting from integer to boolean
Date
Msg-id 20080327074031.GA5519@svana.org
Whole thread Raw
In response to Re: casting from integer to boolean  (Seb <spluque@gmail.com>)
Responses Re: casting from integer to boolean  ("Richard Broersma" <richard.broersma@gmail.com>)
List pgsql-general
On Wed, Mar 26, 2008 at 05:28:18PM -0500, Seb wrote:
> > INSERT INTO my_table (var_bool) VALUES ( CAST( 0 AS BOOLEAN )); or
> > INSERT INTO my_table (var_bool) VALUES (0::BOOLEAN);
>
> Thanks Richard.  Is there a way to do it without changing the INSERT
> command?  As I mentioned, there are many more columns of different
> types, so finding and replacing the VALUES would be very difficult.

Don't think anyone mentioned it, but if you could get it to output
quotes around the value, like:

INSERT INTO my_table (var_bool) VALUES ('0');

It will also work.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Survey: renaming/removing script binaries (createdb, createuser...)
Next
From: Martijn van Oosterhout
Date:
Subject: Re: psql /usr/lib/libgcc dependency in pg 8.3