minimum function - Mailing list pgsql-general

From Gunther Mayer
Subject minimum function
Date
Msg-id 467D477F.3020406@gmail.com
Whole thread Raw
Responses Re: minimum function  (Raymond O'Donnell <rod@iol.ie>)
Re: minimum function  (Martijn van Oosterhout <kleptog@svana.org>)
Re: minimum function  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: B-tree fan-out
Next
From: Martijn van Oosterhout
Date:
Subject: Re: B-tree fan-out