Re: pg_dumpall --roles-only interact with other options - Mailing list pgsql-hackers

From jian he
Subject Re: pg_dumpall --roles-only interact with other options
Date
Msg-id CACJufxG+QncB5axsbV6DGtuDm+nX_vPVdeaVnNMyMGv43w4giA@mail.gmail.com
Whole thread Raw
In response to Re: pg_dumpall --roles-only interact with other options  (wangpeng <215722532@qq.com>)
Responses Re: pg_dumpall --roles-only interact with other options
Re: pg_dumpall --roles-only interact with other options
List pgsql-hackers
On Wed, Feb 4, 2026 at 9:56 AM wangpeng <215722532@qq.com> wrote:
>
> Hi,
> I reviewed and tested this patch. I noticed that:
>    pg_dumpall --globals-only --statistics        ----> error
>    pg_dumpall --globals-only --statistics-only   ----> pass
> maybe there is inconsistent for *-only options
> is that intentional?
>

Thanks for pointing this out.
It should fail too. I missed this combination.
The attached v2 should be bullet-proof.

On Wed, Feb 4, 2026 at 5:25 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> I wonder if we ought to create "derivative flags" like we did for pg_dump
> in commit 96a81c1be9.  That could make some of this stuff easier to
> maintain and to follow.

https://git.postgresql.org/cgit/postgresql.git/commit/?id=96a81c1be929d122719bd289f6e24824f37e1ff6
added new fields to RestoreOptions and DumpOptions.

These global objects dump(roles, tablespaces) are not directly related to
pg_restore for now, pg_restore does not support options like --roles-only
or --tablespaces-only. Creating "derivative flags" requires careful
consideration of their default values, which adds complexity for relatively
little benefit. Overall we don't need to implement similar logic now, i think.

commitgest entry: https://commitfest.postgresql.org/patch/6459


--
jian
https://www.enterprisedb.com/

Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Fix pg_stat_get_backend_wait_event() for aux processes
Next
From: Shlok Kyal
Date:
Subject: Re: Skipping schema changes in publication