Re: LEAST and GREATEST functions? - Mailing list pgsql-sql

From Josh Berkus
Subject Re: LEAST and GREATEST functions?
Date
Msg-id 200307011704.26768.josh@agliodbs.com
Whole thread Raw
In response to Re: LEAST and GREATEST functions?  (Joe Conway <mail@joeconway.com>)
Responses Re: LEAST and GREATEST functions?  (Joe Conway <mail@joeconway.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Joe Conway
Date:
Subject: Re: LEAST and GREATEST functions?
Next
From: Joe Conway
Date:
Subject: Re: LEAST and GREATEST functions?