Re: pg_dump --with-* options

Corey Huinker <corey.huinker@gmail.com>

From: Corey Huinker <corey.huinker@gmail.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Jeff Davis <pgsql@j-davis.com>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-16T19:35:48Z
Lists: pgsql-hackers
>
> I noticed that --statistics (i.e., the current --with-statistics) causes
> statistics to be dumped even when used with --data-only or --schema-only.
> So, as far as I understand, here are the possible combinations of dump
> targets and options:
>

Those should also be mutually exclusive, and I'll write up a patch to add
them to the checks.


>
>   schema, data, stats:       --statistics
>   schema, data:              (default)
>   schema, stats:             --schema-only --statistics
>   data, stats:               --data-only --statistics
>   schema only:               --schema-only
>   data only:                 --data-only
>   stats only:                --statistics-only
>
> This makes me wonder if --no-data and --no-schema are still necessary.
> They were also introduced in v18, but might now be redundant. If so,
> should we consider removing them?
>
> If we do keep them, we could also use --no-schema --statistics to
> dump data and statistics, but I find --data-only --statistics more
> intuitive.
>

I think this is the exact sort of confusion caused by having two of the
three types default to on in all circumstances, and one default to off in
one special circumstance.

Let's keep this simple, and have all three types default to on in all
circumstances.

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.