Re: pg_dump --with-* options

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(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-14 07:05:36
Message-ID: 94f89b0a-5d83-4a67-9092-50ba3913441c@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025/06/14 5:32, Nathan Bossart wrote:
> On Fri, Jun 13, 2025 at 08:58:04AM -0700, Jeff Davis wrote:
>> On Fri, 2025-06-13 at 09:39 +0900, Fujii Masao wrote:
>>> By the way, if we keep --with-statistics in pg_dump, are we planning
>>> to
>>> continue using the --with-xxx naming pattern for new options that
>>> specify extra data to dump?
>>
>> Good point. Now that we are getting rid of some of the other options,
>> we don't need to worry about consistency with them, and I think we
>> should just use "--statistics".
>
> +1

+1

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:

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.

Regards,

--
Fujii Masao
NTT DATA Japan Corporation

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Perumal Raj 2025-06-14 08:08:50 Resolved: Logical Replication slot disappeared after promote Standby
Previous Message David Rowley 2025-06-14 07:04:28 Re: Make tuple deformation faster