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 1vs42a-003jBX-0i for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 19:13:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vs42Y-0054w6-33 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 19:13:51 +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 1vs42Y-0054vy-2B for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 19:13:50 +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 1vs42W-000000014RD-2VwP for pgsql-hackers@postgresql.org; Mon, 16 Feb 2026 19:13:50 +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 61GJDjTt1166846; Mon, 16 Feb 2026 14:13:45 -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> Comments: In-reply-to Andres Freund message dated "Mon, 16 Feb 2026 13:54:49 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1166844.1771269225.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 16 Feb 2026 14:13:45 -0500 Message-ID: <1166845.1771269225@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > I wish we could just generate the parse-analyzed representation for defa= ult > values during bootstrap, but that's probably not realistic. > Although, I guess we don't really need the full machinery. Afaict we jus= t 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