Re: pg_get__*_ddl consolidation

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "Japin Li" <japinli(at)hotmail(dot)com>, "Zsolt Parragi" <zsolt(dot)parragi(at)percona(dot)com>, "Euler Taveira" <euler(at)eulerto(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_get__*_ddl consolidation
Date: 2026-04-06 15:24:06
Message-ID: DHM6C7SLS4BN.1WW9Z4PRPN0VJ@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 6 Apr 2026 at 13:55, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> There was quite a deal of discussion around this mechanism. See Euler's
> review at [1] and follow-up at [2] for the original discussion of the
> VARIADIC option-parsing design and the use cases it was meant to
> address. I'm prepared to revisit it is there's a strong consensus on the
> point.

Thanks for those links. I had not seen that part of the discussion. But
I only see an explanation of why these functions are configurable with
optional key+value pairs in their arguments. I think that makes sense,
and I totally agree that we should do that.

The thing I'm questioning is whether we need a new way of providing
key+value pairs as optional arguments to functions. IMO we already had a
perfectly fine one. Introducing another adds complexity (both to the
code and to the user) and I don't see any compelling reason to do so.

Attached is a patch with roughly what I have in mind instead. By doing
this we can also make the functinos STRICT, so that we don't have to
worry about handling NULL values for the first argument.

Afaict this named parameter approach only has benefits over the VARIADIC
argument one. But if I'm wrong about that, please let me know.

Attachment Content-Type Size
v5-0001-Use-named-arguments-for-pg_get_-_ddl-functions.patch text/x-patch 26.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2026-04-06 15:25:47 Re: PG 19 release notes and authors
Previous Message Robert Haas 2026-04-06 15:22:42 Re: Add custom EXPLAIN options support to auto_explain