Re: generating function default settings from pg_proc.dat
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Andrew Dunstan <andrew@dunslane.net>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-02-16T19:13:45Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > I wish we could just generate the parse-analyzed representation for default > values during bootstrap, but that's probably not realistic. > Although, I guess we don't really need the full machinery. Afaict we just need > a list of simple CONST nodes. Const is enough to be problematic. In particular, the bytes of the stored Datum are shown in physical order so that the results are endian-dependent. We can't have machine dependencies in postgres.bki. I suppose it might be possible to rethink the printed representation of Const nodes to dodge that problem, but that's starting to make the project seem rather complex. Even without that, hand-maintained byte-level representations of jsonb, float8, text[] seem like a pretty bad idea. I think what we'd really want here is some smarts in backend bootstrap mode to be able to invoke the correct datatype input function to convert the type's standard string representation into a Datum. I wonder how complicated that'd be. regards, tom lane
Commits
-
Simplify creation of built-in functions with non-default ACLs.
- f95d73ed4332 19 (unreleased) landed
-
Be more wary of false matches in initdb's replace_token().
- 7664319ccb02 19 (unreleased) landed
-
Simplify creation of built-in functions with default arguments.
- 759b03b24ce9 19 (unreleased) landed