From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Jeff Davis <pgsql@j-davis.com>
To: Robert Haas <robertmhaas@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_dump --with-* options
Date: Fri, 11 Jul 2025 09:12:02 +0900
Message-ID: <b1e217e4-0527-48ba-9d8a-74106d47f216@oss.nttdata.com> (raw)
In-Reply-To: <d64d902780ab6f95ea30093b4985d097d7b29605.camel@j-davis.com>
References: <7cc52488-f876-4ad3-affd-6e4b0ef0cb09@eisentraut.org>
<aEMLzPQtjRbj2R7X@nathan>
<CA+TgmoactJEUHeXuxHLKNXHzm6-XrQFigPur-4nHTMFSiSRkiQ@mail.gmail.com>
<aErpuM6RXSlK1FBW@nathan>
<7bf0246542713d80f12c738c1d365d1365750c18.camel@j-davis.com>
<5e398522803da9bf3f9fc33ca43084ec21ab0fcd.camel@j-davis.com>
<aFLenfMRS9jFINxq@nathan>
<031558c60e84362898922caa6a90587e7fdf2a57.camel@j-davis.com>
<CA+TgmoYW4ycbzZehdS9nOw60ZdtwzWZ-qoVpBe3+QCpeBxvKug@mail.gmail.com>
<aFrWvlsWwE92Mcpr@nathan>
<CA+TgmoYuP7TvwThJERO2X7CHJCrTMpiv=Fd=EPOcyWwL=8J4Hg@mail.gmail.com>
<3cc4f166-0b58-47e2-a03c-7c2873d62b14@oss.nttdata.com>
<d64d902780ab6f95ea30093b4985d097d7b29605.camel@j-davis.com>
On 2025/07/11 2:57, Jeff Davis wrote:
> 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.
I agree it would be better to have the same options in both pg_dump
and pg_restore, if possible.
But to do that, we'd either need to make pg_dump dump statistics
by default, or allow redundant options like --statistics in pg_restore,
even though it already restores statistics by default.
As I understand it, the rough consensus so far is that we'd prefer to
avoid both of these approaches. I know some want to change the default
behavior about statistics in pg_dump, though.
But, are you suggesting we go with one of them?
Regards,
--
Fujii Masao
NTT DATA Japan Corporation
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, pgsql@j-davis.com, robertmhaas@gmail.com, nathandbossart@gmail.com, peter@eisentraut.org
Subject: Re: pg_dump --with-* options
In-Reply-To: <b1e217e4-0527-48ba-9d8a-74106d47f216@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox