Received: from Stimpy.netroedge.com (IDENT:phil@Stimpy.netroedge.com [206.58.104.66]) by hub.org (8.9.3/8.9.3) with ESMTP id UAA40358 for ; Fri, 11 Feb 2000 20:51:24 -0500 (EST) (envelope-from phil@Stimpy.netroedge.com) From: phil@Stimpy.netroedge.com Received: (from phil@localhost) by Stimpy.netroedge.com (8.9.1a/8.9.1) id RAA04607 for pgsql-sql@postgresql.org; Fri, 11 Feb 2000 17:52:51 -0800 Date: Fri, 11 Feb 2000 17:52:50 -0800 To: pgsql-sql@postgresql.org Subject: Type casting bool as int4? Message-ID: <20000211175250.N14052@Stimpy.netroedge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i This seems like it would be simple, but I'm having troubles getting it to work. All I wish to do is have Postgresql return '0' or '1' instead of 'f' or 't' for bool types. This would simplify life for me since I'm trying to dump these values right into expressions outside of the context of SQL. Right now my parsers are choking on the 't's and 'f's from PostgreSQL. I've tried: select mybool::int4; But, I get, ERROR: function int4(bool) does not exist Hummm.... I want to do something like: select (mybool?1:0); But, that's not the right syntax. I'd love to be able to get this working w/o defining new functions or types (i.e., make it portable). Ideas? I've poured over the documentation and the current function and operators, but this doesn't seem to be implemented?! Thanks! Phil -- Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR phil@netroedge.com -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A