Re: updates for handling optional argument in system functions
Mark Wong <markwkm@gmail.com>
From: Mark Wong <markwkm@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2026-01-20T18:15:13Z
Lists: pgsql-hackers
Attachments
Hi everyone, On Tue, Dec 09, 2025 at 03:28:59PM -0800, Mark Wong wrote: > Hi everyone, > > I noticed how it was preferred to define optional arguments with the > system functions in system_functions.sql instead of defining them in > pg_proc.dat. > > I took a gross stab at updating the ones that ended in _ext, which > turned out to be 7 declarations across 6 system functions, and created a > patch per system function, hoping it would be easier to review. > > Perhaps the most interesting thing to share is the total reduction of > the lines of code, although system_functions.sql only grows: > > src/backend/catalog/system_functions.sql | 49 ++++++++ > src/backend/utils/adt/ruleutils.c | 130 ---------------------- > src/include/catalog/pg_proc.dat | 36 ++---- > 3 files changed, 56 insertions(+), 159 deletions(-) > > > Is that something we want? I fixed an error caught by the address sanitizer in CI [1] and am uploading a new patchset. The only change is to 2 lines in v2-0005-Handle-pg_get_expr-default-args-in-system_functio.patch to update a call to pg_get_expr with the correct number of arguments in tablecmds.c. Regards, Mark [1] https://cirrus-ci.com/task/6109065824174080 -- Mark Wong <markwkm@gmail.com> EDB https://enterprisedb.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Simplify creation of built-in functions with default arguments.
- 759b03b24ce9 19 (unreleased) cited