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

From Seb
Subject Re: casting from integer to boolean
Date
Msg-id 871w5xqead.fsf@patagonia.sebmags.homelinux.org
Whole thread Raw
In response to casting from integer to boolean  (Seb <spluque@gmail.com>)
List pgsql-general
On Wed, 26 Mar 2008 22:46:08 +0000,
Sam Mason <sam@samason.me.uk> wrote:

[...]

> You could turn the problem around and make the bool columns into ints
> (which should be a simple search-and-replace, I hope) and then write
> something (again hopefully simple) to turn them all back into bools.
> I.e. lots of:

>   ALTER TABLE my_table ALTER var_bool TYPE bool USING var_bool::bool;


Yes! Good idea, I think I can collect the names of the tables and
columns with boolean fields and then use that as you say.  Thanks
everybody.


--
Seb

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: casting from integer to boolean
Next
From: David Fetter
Date:
Subject: Re: Survey: renaming/removing script binaries (createdb, createuser...)