X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 658FD310A56 for ; Wed, 2 Jul 2003 06:05:13 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 86333-03 for ; Wed, 2 Jul 2003 03:05:02 -0300 (ADT) Received: from cerebro.int-bytecraft.com (unknown [219.93.229.26]) by svr1.postgresql.org (Postfix) with ESMTP id 749AC3109BD for ; Wed, 2 Jul 2003 03:05:01 -0300 (ADT) Received: from bytecraft.com.my (home.int-bytecraft.com [127.0.0.1]) by cerebro.int-bytecraft.com (8.11.6/8.11.6) with ESMTP id h6262Mq13948; Wed, 2 Jul 2003 14:02:23 +0800 Message-ID: <3F0277E6.9090906@bytecraft.com.my> Date: Wed, 02 Jul 2003 14:12:54 +0800 From: Ang Chin Han User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Greg Stark , Josh Berkus , Stefan Bill , pgsql-sql@postgresql.org Subject: Re: LEAST and GREATEST functions? References: <20030630201057.14507.qmail@web13905.mail.yahoo.com> <200306302032.23113.josh@agliodbs.com> <87d6gu2otf.fsf@stark.dyndns.tv> <3F025942.6000507@bytecraft.com.my> <24828.1057124242@sss.pgh.pa.us> In-Reply-To: <24828.1057124242@sss.pgh.pa.us> X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDDD07440B410C556D2675993" X-Archive-Number: 200307/38 X-Sequence-Number: 14152 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDDD07440B410C556D2675993 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Tom Lane wrote: > But COALESCE is a special feature hard-wired into the parser. There's > no free lunch --- you pay for your extensibility somewhere. That's what I'm suggesting: hard-wiring LEAST and GREATEST into the parser. 7.5, maybe? The question is: is it worth hard-wiring vs functions? (time passes) Doesn't seem to be in SQL92. It's in Oracle, Interbase and MySQL, though, says google. I'd say we need to have LEAST and GREATEST at least somewhere in contrib (as functions) if not core, to make transition from other RDBMS to postgresql easier. A brief test shows that we would incur quite a performance penalty (I compared COALESCE with coalesce_sql_function) if it isn't hardwiring. -- Linux homer 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux 1:30pm up 188 days, 4:35, 4 users, load average: 5.03, 5.06, 5.08 --------------enigDDD07440B410C556D2675993 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/AnfqNYbTUIgzwfARAvEZAJ0Rmu2OEitV2wwgMD9O76VB1sgkyACfTGcu +wqPp25pNy1NxS7p4zw+nHw= =e1/U -----END PGP SIGNATURE----- --------------enigDDD07440B410C556D2675993--