Re: pg_dump --with-* options

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump --with-* options
Date: 2025-06-18 17:21:37
Message-ID: 031558c60e84362898922caa6a90587e7fdf2a57.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2025-06-18 at 10:43 -0500, Nathan Bossart wrote:
> IIUC the current proposal is to:
>
> * Dump/restore stats by default.
> * Keep the --no-statistics, --no-schema, and --no-data options.
> * Keep the --statistics-only, --schema-only, and --data-only options.
> * Remove the --with-statistics, --with-schema, and --with-data
> options.
>
> How does that sound?

For those that want to keep stats off by default, another proposal
might be:

* keep stats defaults as they are now (pg_dump defaults to "off",
pg_restore defaults to "on")
* delete the --with-data and --with-schema options as unnecessary
* (maybe?) rename --with-statistics to --statistics
* keep --no-statistics, --no-data, --no-schema (or use "without"
instead?)
* (maybe?) keep --statistics-only
* reject the combination of an "only" option and a "with" option

That removes 2 or three options, and rejects some ambiguous
combinations. That would seem to address some of the immediate concerns
raised in this thread, without needing to relitigate the default.

It also leaves the door open to potentially change the default for
stats to "on" in the future, because we will have both --with-
statistics and --no-statistics.

The only downside of this approach is that we'd be stuck with both --
with-statistics and --no-statistics forever. That's a bit inconsistent
with the other options, and it doesn't satisfy Robert's concern about
the --help output. But Robert also wants stats off by default for
pg_dump and on by default for pg_restore, which I think means we need
both --with-statistics and --no-statistics anyway. Robert, comments?

Regards,
Jeff Davis

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-06-18 17:22:10 Re: minimum Meson version
Previous Message Jesper Pedersen 2025-06-18 17:20:54 Re: minimum Meson version