We currently don't support cases when RECORD-returning UDF doesn't have a RETURN stmt in the root block that would restrict the wildcard type to a concrete one. For example:
CREATE FUNCTION f1() RETURNS RECORD AS $$
BEGIN
END;
$$ LANGUAGE PLpgSQL;
CREATE FUNCTION f2(b BOOL) RETURNS RECORD AS $$
BEGIN
IF b THEN
RETURN f1();
ELSIF true THEN
DECLARE
BEGIN
END;
END IF;
END;
$$ LANGUAGE PLpgSQL;
We currently don't support cases when RECORD-returning UDF doesn't have a RETURN stmt in the root block that would restrict the wildcard type to a concrete one. For example:
Jira issue: CRDB-38131