Re: ArchiveEntry optional arguments refactoring - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ArchiveEntry optional arguments refactoring
Date
Msg-id 5606.1548264726@sss.pgh.pa.us
Whole thread Raw
In response to Re: ArchiveEntry optional arguments refactoring  (Andres Freund <andres@anarazel.de>)
Responses Re: ArchiveEntry optional arguments refactoring  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-01-23 13:58:07 -0300, Alvaro Herrera wrote:
>> It does.  How does pgindent behave with it?

> It craps out:
> Error@3649: Unbalanced parens
> Warning@3657: Extra )

> But that can be worked around with something like

>         te = ArchiveEntry(fout, tdinfo->dobj.catId, tdinfo->dobj.dumpId,
>                           ARCHIVE_ARGS(.tag = tbinfo->dobj.name,
>                                        .namespace = tbinfo->dobj.namespace->dobj.name,
>                                        .owner = tbinfo->rolname,
>                                        .desc = "TABLE DATA",
>                                        .section = SECTION_DATA,
>                                        .copyStmt = copyStmt,
>                                        .deps = &(tbinfo->dobj.dumpId),
>                                        .nDeps = 1,
>                                        .dumpFn = dumpFn,
>                                        .dumpArg = tdinfo,
>                                        ));
> which looks mildly simpler too.

That looks fairly reasonable from here, but I'd suggest
ARCHIVE_OPTS rather than ARCHIVE_ARGS.

Can we omit the initial dots if we use a wrapper macro?  Would it be
a good idea to do so (I'm not really sure)?

            regards, tom lane


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: ArchiveEntry optional arguments refactoring
Next
From: Andres Freund
Date:
Subject: Re: ArchiveEntry optional arguments refactoring