Joe Conway <mail@joeconway.com> writes:
> It seems that "any" is not accepted as a function parameter type.
You have to double-quote it.
We could perhaps rename it to avoid the keyword conflict; I'd lean
towards "anytype" if we do ("anyscalar" seems misleading; I'd expect
that to exclude arrays). I think I chose ANY because there was
precedent in CREATE AGGREGATE for that.
> So far, so good. But now the second problem:
> select f1[2] from
> (select array_push('{1,2}'::integer[],3::integer) as f1) as t;
> ERROR: transformArraySubscripts: type anyarray is not an array
Mph. I'm not sure we can make that work readily ... unless you want
to make the parser assume that a function taking and returning ANYARRAY
actually returns the same array type as its input is. Otherwise the
parser has no way to determine the datatype yielded by f1[2].
regards, tom lane