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

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

jian he 写于 2026/2/3 10:15:
> hi.
>
> please check the attached.
>
> pg_dumpall --roles-only --statistics-only
> pg_dumpall --roles-only --data-only
> pg_dumpall --roles-only --schema-only
> pg_dumpall --roles-only --statistics
> pg_dumpall --tablespaces-only --statistics-only
> pg_dumpall --tablespaces-only --data-only
> pg_dumpall --tablespaces-only --schema-only
> pg_dumpall --tablespaces-only --statistics
> pg_dumpall --globals-only --statistics
>
> the above will all error out.
> ``pg_dumpall --globals-only --statistics`` should error,
> the HEAD behavior does not respect "--statistics", maybe we can make
> it not error out, but
> that would contradict the meaning of "--globals-only", i think.
>
> pg_dumpall --roles-only --no-schema --file=1.sql
> pg_dumpall --roles-only --no-data --file=2.sql
> pg_dumpall --roles-only --no-statistics --file=3.sql
> pg_dumpall --tablespaces-only --no-schema --file=1.sql
> pg_dumpall --tablespaces-only --no-data --file=2.sql
> pg_dumpall --tablespaces-only --no-statistics --file=3.sql
>
> The items listed above respect the 'only' option but ignore the 'no' option."
>
>
> --
> jian
> https://www.enterprisedb.com/

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?

Best regards,
--
wangpeng

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2026-02-04 02:37:31 Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements
Previous Message Michael Paquier 2026-02-04 01:55:47 Re: Add expressions to pg_restore_extended_stats()