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

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, wangpeng <215722532(at)qq(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dumpall --roles-only interact with other options
Date: 2026-02-24 01:10:46
Message-ID: CACJufxErxeLTMzmCpgz1cetUk6xEPxGV=nFH=wdW4XLoHv-6ZA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 10, 2026 at 3:47 AM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> > Is there a reason we need to duplicate these checks in pg_dumpall when they
> > are already handled by pg_dump?
>
> Mainly I think it would be a nicer user experience to fail early
> without generating additional output other than the error message
> (currently it writes out 26 lines before the error), but there are
> also two specific reasons why it would be an improvement:
>
> * "--schema-only --no-schema" is already a contradiction before
> pg_dumpall calls pg_dump: should it print out roles/tablespaces or
> not? (it doesn't)
> * if you specify "pg_dumpall --data-only -no-data -f dump.sql", or
> redirect stdout to a file, it writes out a partial dump before
> failing, and leaves it there. Users should check error messages and
> exit codes, but the file is still there and could cause accidents. 3
> simple checks could prevent this.

OK. The attached v6 added these 3 "--only" and "--no" checks, along
with related tests.

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

Attachment Content-Type Size
v6-0001-pg_dumpall-error-out-conflict-options.patch text/x-patch 13.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-02-24 01:17:23 Re: pgsql: libpq: Grease the protocol by default
Previous Message Alexandra Wang 2026-02-24 01:10:02 Re: pg_plan_advice