Re: pg_dumpall --roles-only interact with other options

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: wangpeng <215722532(at)qq(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dumpall --roles-only interact with other options
Date: 2026-02-04 08:14:59
Message-ID: CACJufxG+QncB5axsbV6DGtuDm+nX_vPVdeaVnNMyMGv43w4giA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 4, 2026 at 9:56 AM wangpeng <215722532(at)qq(dot)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(at)gmail(dot)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 Content-Type Size
v2-0001-pg_dumpall-error-out-conflict-option.patch text/x-patch 9.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shlok Kyal 2026-02-04 08:16:06 Re: Skipping schema changes in publication
Previous Message Bertrand Drouvot 2026-02-04 08:02:00 Re: Fix pg_stat_get_backend_wait_event() for aux processes