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-17T15:24:42Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> If we convert to cstring below anyway, why not make it a cstring array?

Ha, I'd forgotten that cstring[] is a thing.  Yup, that'd save one
step.

> I don't mind the hack, but I wonder about it location. It's odd that the
> caller puts the return value of ConvertOneProargdefaultsValue() into the
> values array, but then ConvertOneProargdefaultsValue() also sets
> pronargdefaults?

Yeah, I'd gone back and forth about whether this function ought to
return the converted datum or just shove it into values[] directly.
Given that it's also filling the pronargdefaults entry, it probably
should take the latter approach.

I'll post a v2 in a bit.  Thanks for reviewing!

			regards, tom lane



Commits

  1. Simplify creation of built-in functions with non-default ACLs.

  2. Be more wary of false matches in initdb's replace_token().

  3. Simplify creation of built-in functions with default arguments.