Re: pg_dump --with-* options

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>, Robert Haas <robertmhaas@gmail.com>, Nathan Bossart <nathandbossart@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-10T17:57:14Z
Lists: pgsql-hackers
On Wed, 2025-06-25 at 08:18 +0900, Fujii Masao wrote:
> For pg_dump and pg_dumpall, I agree with Jeff's idea in [1],
> but if the statistics is skipped by default, I don't think
> we need a --no-statistics option. So, here's how I think
> the options should work:
> 
>      * Keep: --schema-only, --data-only, --statistics-only, --no-
> schema, --no-data, -and -statistics
>      * Remove: --no-statistics, --with-schema, and --with-data

...

> For pg_restore, I believe there's agreement to restore statistics
> by default if they exist in the archive. So:
> 
>      * Keep: --schema-only, --data-only, --statistics-only, --no-
> schema, --no-data, and --no-statistics
>      * Remove: --with-schema, --with-data, and --statistics

That means pg_dump will accept --statistics and reject --no-statistics;
and pg_restore will accept --no-statistics and reject --statistics.
Other options are mostly the same between them, so I'm not sure it's a
good idea for them to diverge.

Regards,
	Jeff Davis




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Simplify options in pg_dump and pg_restore.

  2. pg_dump: reject combination of "only" and "with"

  3. Change pg_dump default for statistics export.