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 5EF48D87A1; Thu, 1 Sep 2005 17:56:46 -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 21116-02; Thu, 1 Sep 2005 20:56:44 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 145D7D8797; Thu, 1 Sep 2005 17:56:43 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j81Kuj3x006400; Thu, 1 Sep 2005 16:56:45 -0400 (EDT) To: "Marc G. Fournier" Cc: pgsql-hackers@postgresql.org Subject: Re: ALTER TABLE ( smallinto -> boolean ) ... In-reply-to: <20050901174341.N1044@ganymede.hub.org> References: <20050829201253.X1044@ganymede.hub.org> <15013.1125359379@sss.pgh.pa.us> <20050901174341.N1044@ganymede.hub.org> Comments: In-reply-to "Marc G. Fournier" message dated "Thu, 01 Sep 2005 17:49:02 -0300" Date: Thu, 01 Sep 2005 16:56:45 -0400 Message-ID: <6399.1125608205@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/78 X-Sequence-Number: 72475 "Marc G. Fournier" writes: > On Mon, 29 Aug 2005, Tom Lane wrote: >> No, because there's no built-in cast from smallint to bool. > 'k, I just took a read through the "CREATE CAST" man page, and don't think > I can use that for this, Sure you can. Make a SQL or PLPGSQL function that does the conversion you want and then create a cast using it. regards, tom lane