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

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-01-31T16:21:49Z
Lists: pgsql-hackers
On Sat, Jan 31, 2026 at 11:50:50AM +0800, jian he wrote:
> pg_dumpall --verbose --roles-only --no-schema --file=1.sql
> pg_dumpall --verbose --roles-only --no-data --file=2.sql
> pg_dumpall --verbose --roles-only --no-statistics --file=3.sql

These seem permissible to me.  The --no-* options are redundant, but the
user intent seems clear.

> pg_dumpall --verbose --roles-only --statistics-only --file=4.sql
> pg_dumpall --verbose --roles-only --data-only --file=5.sql
> pg_dumpall --verbose --roles-only --schema-only --file=6.sql
>
> [...]
>
> This situation also happens to another pg_duampall option:
> --tablespaces-only.

Yeah, conflicting --*-only options should probably cause errors, like we do
for pg_dump.

-- 
nathan



Commits

  1. pg_dumpall: Fix handling of conflicting options.

  2. pg_dump: Add dumpSchema and dumpData derivative flags.