Hello
GREATEST and LEAST are SQL functions, but it is not internal functions
listed in pg_proc table due different implementation. It is much more
similar to CASE statement than function although syntax is same.
for your purpose, you should to create SQL function wrapper of this
construct - then
In trying to learn about aggregates, I came across this seemingly odd
behavior:
(postgres@[local]:5435 08:27:42) [postgres]> CREATE AGGREGATE example_max
(TEXT) (SFUNC = greatest, STYPE = TEXT);
ERROR: syntax error at or near "greatest"
LINE 1: CREATE AGGREGATE example_max (TEXT) (SFUNC = greate