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 A4773D84EB; Tue, 30 Aug 2005 10:18:16 -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 58702-02; Tue, 30 Aug 2005 13:17:44 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id EF934D84BD; Tue, 30 Aug 2005 10:17:41 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1EA5zi-0002SA-00; Tue, 30 Aug 2005 09:17:42 -0400 To: Tom Lane Cc: "Marc G. Fournier" , pgsql-hackers@postgresql.org Subject: Re: ALTER TABLE ( smallinto -> boolean ) ... References: <20050829201253.X1044@ganymede.hub.org> <15013.1125359379@sss.pgh.pa.us> In-Reply-To: <15013.1125359379@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 30 Aug 2005 09:17:42 -0400 Message-ID: <874q974l8p.fsf@stark.xeocode.com> Lines: 14 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200508/1110 X-Sequence-Number: 72305 Tom Lane writes: > You could do something like > > ... type boolean using case when field1=0 then false else true end; Or you could save typing and just use "USING field1<>0" Odd that everyone did a CASE for that. -- greg