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 028EA310D8E for ; Wed, 2 Jul 2003 00:05:00 +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 52802-06 for ; Tue, 1 Jul 2003 21:04:49 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by svr1.postgresql.org (Postfix) with ESMTP id 4EE92310C00 for ; Tue, 1 Jul 2003 21:04:49 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3173633; Tue, 01 Jul 2003 17:05:03 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Joe Conway , Greg Stark Subject: Re: LEAST and GREATEST functions? Date: Tue, 1 Jul 2003 17:04:26 -0700 User-Agent: KMail/1.4.3 Cc: Stefan Bill , pgsql-sql@postgresql.org References: <20030630201057.14507.qmail@web13905.mail.yahoo.com> <87d6gu2otf.fsf@stark.dyndns.tv> <3F01ED9F.3060704@joeconway.com> In-Reply-To: <3F01ED9F.3060704@joeconway.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200307011704.26768.josh@agliodbs.com> X-Archive-Number: 200307/28 X-Sequence-Number: 14142 Joe, > create or replace function greatest(anyelement, anyelement) returns > anyelement as 'select case when $1 > $2 then $1 else $2 end' language > 'sql'; Way cool. I'd have to imagine that it would blow up if you did this, though: select greatest ( 512, now() ); With an "Operator is not defined" error, hey? -- Josh Berkus Aglio Database Solutions San Francisco