minimum function

From: Gunther Mayer <gunther(dot)mayer(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: minimum function
Date: 2007-06-23 16:17:03
Message-ID: 467D477F.3020406@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

I'm busy writing a trigger function in pl/pgsql and find myself in need
of a minimum() function. I can't see how the builtin min() aggregate
function can be of any use here since all I want to do is something like

SELECT minimum(5,6) => 5

Any way I can achieve that on one line? I.e. I want it simpler than

IF arg1 < arg2 THEN
RETURN arg1;
ELSE
RETURN arg2;
END IF;

Gunther

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-06-23 16:34:03 Re: B-tree fan-out
Previous Message Tom Lane 2007-06-23 16:10:03 Re: B-tree fan-out