Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vs4oO-004UkR-2N for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 20:03:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vs4nO-005PNT-1G for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 20:02:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vs4nO-005PNE-0N for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 20:02:14 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vs4nM-000000014ou-1J69 for pgsql-hackers@postgresql.org; Mon, 16 Feb 2026 20:02:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 61GK23me1172936; Mon, 16 Feb 2026 15:02:03 -0500 From: Tom Lane To: Andres Freund cc: Andrew Dunstan , PostgreSQL-development Subject: Re: generating function default settings from pg_proc.dat In-reply-to: References: <183292bb-4891-4c96-a3ca-e78b5e0e1358@dunslane.net> <1166845.1771269225@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Mon, 16 Feb 2026 14:47:07 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1172934.1771272123.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 16 Feb 2026 15:02:03 -0500 Message-ID: <1172935.1771272123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2026-02-16 14:13:45 -0500, Tom Lane wrote: >> 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 was more thinking we would teach bootstrap.c/bootparse.y to generate t= he > List(Const+) from a simpler representation that would be included in > postgres.bki, rather than include the node tree soup in postgres.bki. Right, maintaining pg_node_tree strings is exactly what we don't want to do. > Looks like the slightly difficult bit is that we haven't assembled the p= g_proc > row by the time we'd do the OidInputFunctionCall() in InsertOneValue(), = so > we'd not trivially know the type of the corresponding column. Ah, I'd not got far enough to notice that. > But if we made the input something like {'some'::type1, 'value'::type2},= we > wouldn't need to know the corresponding column's type, and genbki could = build > it. Hmm. Your idea of a bespoke 'proc' command would avoid the need for duplication, I think, although I'm not sure how to write that without it becoming its own source of maintenance pain. > Particularly for SRFs, I find it rather painful to keep proargtypes, > proallargtypes, proargmodes, proargnames in sync. Not helped by proargty= pes > and proallargtypes/proargmodes/... having a different input syntax. I'v= e > spent too much time trying to keep the arguments of stats functions in s= ync. Agreed, we could stand to do that better. > proargs =3D> [ > {type =3D> 'name', name =3D> 'slot_name'}, > {type =3D> 'name', name =3D> 'plugin'}, > {type =3D> 'bool', name =3D> 'temporary', default =3D> 'false'}, > {type =3D> 'bool', name =3D> 'twophase', default =3D> 'false'}, > {type =3D> 'bool', name =3D> 'failover', default =3D> 'false'}, > ], > prorettype =3D> [ > {type =3D> 'name', name =3D> 'slot_name'}, > {type =3D> 'pg_lsn', name =3D> 'lsn'}, > ] > } I'd be inclined to keep prorettype separate from the output arguments, but otherwise something like this seems attractive. Who's going to work on this? I'm happy to take a swing at it, but don't want to duplicate someone else's effort. regards, tom lane