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 3DECF310EED for ; Wed, 2 Jul 2003 05:37:58 +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 59883-10 for ; Wed, 2 Jul 2003 02:37:47 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5FA5E310D27 for ; Wed, 2 Jul 2003 02:37:47 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h625bMQQ024829; Wed, 2 Jul 2003 01:37:22 -0400 (EDT) To: Ang Chin Han Cc: Greg Stark , Josh Berkus , Stefan Bill , pgsql-sql@postgresql.org Subject: Re: LEAST and GREATEST functions? In-reply-to: <3F025942.6000507@bytecraft.com.my> References: <20030630201057.14507.qmail@web13905.mail.yahoo.com> <200306302032.23113.josh@agliodbs.com> <87d6gu2otf.fsf@stark.dyndns.tv> <3F025942.6000507@bytecraft.com.my> Comments: In-reply-to Ang Chin Han message dated "Wed, 02 Jul 2003 12:02:10 +0800" Date: Wed, 02 Jul 2003 01:37:22 -0400 Message-ID: <24828.1057124242@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200307/36 X-Sequence-Number: 14150 Ang Chin Han writes: > If LEAST and GREATEST can accept any number of parameters, wouldn't it > make sense to code it like the way COALESCE works, rather than defining > a function for it? This way we don't need define all the various > functions with different types. But COALESCE is a special feature hard-wired into the parser. There's no free lunch --- you pay for your extensibility somewhere. regards, tom lane