pg_dumpall --roles-only interact with other options

  • Jump to comment-1
    jian he<jian.universality@gmail.com>
    Jan 31, 2026, 3:51 AM UTC
    hi.
    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
    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
    What should we expect for the above commands?
    the current behavior is not good, i think, some even do not dump the
    roles command.
    I would expect the last three commands to raise errors, while the first three
    should simply ignore the options (--no-schema, --no-data, --no-statistics).
    This situation also happens to another pg_duampall option: --tablespaces-only.
    what do you think?
    --
    jian
    https://www.enterprisedb.com/
    • Jump to comment-1
      Nathan Bossart<nathandbossart@gmail.com>
      Jan 31, 2026, 4:21 PM UTC
      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