Skip to content

sql: pg_proc.pronamespace is not populated for built-in functions #94952

@knz

Description

@knz

Found while working on #88061.

Describe the problem

The pronamespace column in pg_proc is NULL for all the built-in functions.

This is incorrect:

  • we want the OID of pg_catalog for all the "base" built-ins
  • and the OID of crdb_internal for the crdb_internal built-ins

Additionally, once the above is achieved, the crdb_internal. prefix should be stripped in the proname column.

To Reproduce

SELECT n.nspname AS "Schema"
    p.proname AS "Name"
FROM pg_proc p
  LEFT JOIN ps_namespace n ON n.oid = p.pronamespace

cc @rafiss for triage.

Jira issue: CRDB-23240
Epic: CRDB-23454

Metadata

Metadata

Assignees

Labels

A-sql-pgcompatSemantic compatibility with PostgreSQLC-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