public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Andres Freund <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: generating function default settings from pg_proc.dat
Date: Mon, 16 Feb 2026 14:13:45 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <lfzlruyq64npjz4z3aiiox2nzg6astxuy5sgmyxm2kwvty4fgq@zcfrpu5jhw5o>
References: <[email protected]>
	<lfzlruyq64npjz4z3aiiox2nzg6astxuy5sgmyxm2kwvty4fgq@zcfrpu5jhw5o>

Andres Freund <[email protected]> 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






view thread (18+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: generating function default settings from pg_proc.dat
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox