--
-- least/2
--
create or replace function least(
  numeric,
  numeric
) returns numeric as $$

DECLARE
        first alias for $1;
        second alias for $2;
BEGIN
        if first < second
        then return first;
        else return second;
        end if;
END;
$$ language plpgsql;