Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.2/8.9.1) with ESMTP id JAA81707 for ; Thu, 15 Apr 1999 09:22:01 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id PAA26503; Thu, 15 Apr 1999 15:21:56 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 10Xnxy-0000FZ-00; Thu, 15 Apr 1999 15:22:10 +0000 Message-ID: <3715E778.7D8ECB99@sferacarta.com> Date: Thu, 15 Apr 1999 15:19:52 +0200 From: =?iso-8859-1?Q?Jos=E9?= Soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: Matthew Hagerty CC: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Urgent, bool-to-int patch possible? References: <4.1.19990414140053.0096de40@mail.venux.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit create function int(bool) returns int as ' begin IF $1 THEN RETURN 1; ELSE RETURN 0; END IF; end; ' language 'plpgsql'; Matthew Hagerty ha scritto: > Greetings, > > What would be the chances of getting a patch for 6.4.2 to do bool-to-int > conversion? I need to do a query similar to this: > > SELECT * FROM mytable ORDER BY > int(col1 > 3) + int(col2 < 4) + ... other conditions; > > (courtesy of Tom Lane) > > Would it be that hard to make a patch to do the conversion? I would try it > myself but I have no idea where to start looking, and I need this sooner > than I could probably figure it out. > > I'm not making demands or stomping my feet, I love postgres and I > understand that it is free software, but if one of you feels really nice... :) > > Thanks, > Matthew