PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> CREATE TABLE test(i INT PRIMARY KEY);
> CREATE FUNCTION func2(i INT) RETURNS INT IMMUTABLE LANGUAGE SQL
> AS 'SELECT $1';
> CREATE FUNCTION func1(c INT) RETURNS INT IMMUTABLE LANGUAGE SQL
> AS 'SELECT func2($1)';
This function is unreliable for lack of schema qualification.
I tend to agree that it'd be nice if pg_upgrade wouldn't be
so picky about that, but we haven't really found a way that
doesn't create security issues (cf CVE-2018-1058).
regards, tom lane