Skip to content

sql: pg_function_is_visible fails for UDFs #94953

@knz

Description

@knz

Found while working on #88061.

Describe the problem

pg_function_is_visible() fails for the OID of UDFs.

To Reproduce

> CREATE FUNCTION myfunc(val INT) RETURNS INT CALLED ON NULL INPUT LANGUAGE SQL AS $$ SELECT val $$;
> select pg_function_is_visible(oid) from pg_proc where proname='myfunc';
ERROR: function 100105 does not exist: function undefined
SQLSTATE: 42883

Expected behavior

All the OID values in pg_proc are valid inputs to pg_function_is_visible.

cc @rafiss @mgartner @chengxiong-ruan for triage.

Jira issue: CRDB-23241
Epic: CRDB-23454

Metadata

Metadata

Assignees

Labels

A-schema-catalogRelated to the schema descriptors collection and the catalog API in general.A-sql-pgcompatSemantic compatibility with PostgreSQLA-sql-routineUDFs and Stored ProceduresA-sql-vtablesVirtual tables - pg_catalog, information_schema etcC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions