Re: pg_get__*_ddl consolidation - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: pg_get__*_ddl consolidation
Date
Msg-id 62b458be-5825-4b22-9d79-bf6e0fcf60eb@dunslane.net
Whole thread
In response to Re: pg_get__*_ddl consolidation  (Jelte Fennema-Nio <postgres@jeltef.nl>)
List pgsql-hackers
On 2026-06-24 We 3:48 PM, Jelte Fennema-Nio wrote:
> On Tue, 7 Apr 2026 at 14:36, Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
>> So to summarize (from my biased viewpoint) I think the downsides are:
>> 1. Uncommon calling convention: only pg_restore_*_stats and
>>     pg_logical_slot_*_changes use it, while all other functions support
>>     named parameters.
>> 2. Needs custom option parsing logic
>> 3. More characters to type because you have to quote booleans, integers
>>     and argument names.
>> 4. Requires functions to be marked as NOSTRICT, which then needs
>>     additional NULL handling
>> 5. It can be unclear to a reader of a query that the function arguments
>>     should be interpreted as key-value pair
>> 6. Breaks auto formatting
>>
>> And the benefit:
>> 1. Forces people to specify the argument name
>>
>> I don't think those benefits outweigh the downsides.
> I'm not sure how I can explain my argument better. I think it'd be sad
> if we standardized these pg_get_ddl_* functions to use this suboptimal
> calling convention.
>
>


I have applied your patch with slight tweaks.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: doc: fix two id/xreflabel inconsistencies in config.sgml
Next
From: Daniel Gustafsson
Date:
Subject: Re: doc: fix two id/xreflabel inconsistencies in config.sgml