dolthub / dolthub/doltgresql

Populate pg_proc with built-in functions

Open
#3,190 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.1k
Forks
73
Avg merge
1d 10h
Merged PRs (30d)
129

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start in server/tables/pgcatalog/pg_proc.go, read how the cache currently uses functions.IterateCurrentDatabase, and inspect the TODO about built-in functions. Trace how framework-registered built-ins expose overload and metadata, then add representative regression coverage for catalog discovery and direct execution, including overloaded functions. Done means all built-ins have stable, duplicate-free PostgreSQL-compatible pg_proc metadata without special-casing hashtext.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.