Skip to content

Populate pg_proc with built-in functions #3190

Description

@fulghum

DoltgreSQL currently omits framework-registered built-in functions from pg_catalog.pg_proc. Built-ins execute normally, but clients that inspect PostgreSQL catalogs cannot discover their names, signatures, argument types, or return types.

For example, PostgreSQL 15.17 exposes pg_catalog.hashtext(text) -> integer, while DoltgreSQL can execute pg_catalog.hashtext(...) but returns no matching pg_proc row. The same limitation applies systemically to other built-ins and predates hashtext support.

server/tables/pgcatalog/pg_proc.go currently builds the cache with functions.IterateCurrentDatabase, which enumerates database/user functions, and contains an explicit TODO: add built-in functions.

The implementation should enumerate all framework-registered built-ins and populate accurate PostgreSQL-compatible metadata for every overload/signature. It should handle stable OIDs, namespaces, argument and return types, strictness, set-returning functions, aggregates/procedures where applicable, and duplicate prevention. It should not special-case individual functions such as hashtext.

Representative regression coverage should confirm both catalog discovery and direct execution for built-ins, including overloaded functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions