Re: In-place conversion of type bool - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: In-place conversion of type bool
Date
Msg-id 20080814134030.GA4232@alvh.no-ip.org
Whole thread Raw
In response to Re: In-place conversion of type bool  ("Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl>)
List pgsql-general
Joost Kraaijeveld wrote:

> > ALTER TABLE ... ALTER COLUMN TYPE might help you.  Use the USING clause
> > if you need a non-default data conversion -- in this case it might look
> > like USING (col = '1') or some such.
>
> ALTER TABLE odbcdest ALTER COLUMN odbc_bool TYPE bool
>
> gives:
>
> ERROR:  column "odbc_bool" cannot be cast to type "bool"

You need a USING clause, as Tom suggests above (even giving an example).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Newbie [CentOS 5.2] service postgresql initdb
Next
From: "Gauthier, Dave"
Date:
Subject: Re: Strange query plan