X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 76E9ED8101 for ; Mon, 29 Aug 2005 20:15:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29958-07 for ; Mon, 29 Aug 2005 23:15:36 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id 79425D8121 for ; Mon, 29 Aug 2005 20:15:36 -0300 (ADT) Received: from localhost (av.hub.org [200.46.204.144]) by hub.org (Postfix) with ESMTP id A39E764B92A for ; Mon, 29 Aug 2005 20:15:40 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28638-06 for ; Mon, 29 Aug 2005 23:15:33 +0000 (GMT) Received: from ganymede.hub.org (blk-222-82-85.eastlink.ca [24.222.82.85]) by hub.org (Postfix) with ESMTP id AFFF164B926 for ; Mon, 29 Aug 2005 20:15:37 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 4DCEC38617; Mon, 29 Aug 2005 20:15:41 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 4C9B238600 for ; Mon, 29 Aug 2005 20:15:41 -0300 (ADT) Date: Mon, 29 Aug 2005 20:15:41 -0300 (ADT) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: pgsql-hackers@postgresql.org Subject: ALTER TABLE ( smallinto -> boolean ) ... Message-ID: <20050829201253.X1044@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.032 required=5 tests=[AWL=-0.018, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/1074 X-Sequence-Number: 72269 I have a table with several 'smallint' fields that I'd like to convert to booleean ... the data in each is either 0 or 1, and: # select '1'::boolean; bool ------ t (1 row) # select '0'::boolean; bool ------ f (1 row) so they do cast as expected ... but, if I try to do the ALTER, I get: # ALTER TABLE table ALTER COLUMN field1 type boolean; ERROR: column "field1" cannot be cast to type "pg_catalog.bool" Should this not work? If not, is there a way to do it so that it will, without having to reload the whole table? Thanks ... ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664