X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 628D5528AD for ; Fri, 3 Jun 2005 12:12:24 -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 88599-07 for ; Fri, 3 Jun 2005 15:12:23 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id 64FB852855 for ; Fri, 3 Jun 2005 12:12:21 -0300 (ADT) Received: (qmail 12071 invoked by uid 500); 3 Jun 2005 15:11:25 -0000 Date: Fri, 3 Jun 2005 10:11:25 -0500 From: Bruno Wolff III To: Markus Bertheau ??? Cc: Michael Glaesemann , PostgreSQL Subject: Re: 'true'::TEXT::BOOLEAN Message-ID: <20050603151125.GA10971@wolff.to> Mail-Followup-To: Bruno Wolff III , Markus Bertheau ??? , Michael Glaesemann , PostgreSQL References: <1117799555.9816.24.camel@dicaprio.akademie1.de> <3DCEDE55-9D4A-4F4E-8907-ADCC058A3398@myrealbox.com> <1117801417.9816.28.camel@dicaprio.akademie1.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1117801417.9816.28.camel@dicaprio.akademie1.de> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/50 X-Sequence-Number: 21651 On Fri, Jun 03, 2005 at 14:23:37 +0200, Markus Bertheau ??? wrote: > This also bypasses the built in postgresql boolean literal parsing. > > I think casting from text to boolean should be possible, and use the > same algorithm that's used when casting from "unknown" to boolean. You probably want boolin. area=> select boolin('0'), boolin('f'), boolin('false'); boolin | boolin | boolin --------+--------+-------- f | f | f (1 row) Note that the function will error out if the argument is garbage.