这是在 postgres 手册中:
CREATE or replace FUNCTION mleast(a VARIADIC numeric[])
RETURNS numeric
AS $$
SELECT min($1[i]) FROM generate_subscripts($1, 1) g(i);
$$ LANGUAGE SQL;
SELECT mleast(10, -1, 5, 4.4);
如果我写:(省略 g(i) )
CREATE or replace FUNCTION mleast(a VARIADIC numeric[])
RETURNS numeric
AS $$
SELECT min($1[i]) FROM generate_subscripts($1, 1);
$$ LANGUAGE SQL;
SELECT mleast(10, -1, 5, 4.4);
我收到:错误不存在列«i»
g(i)到底是什么?