Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ua1O5-00DJ8L-2M for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jul 2025 00:13:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ua1N3-000ePv-35 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jul 2025 00:12:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ua1N2-000eMe-PJ for pgsql-hackers@lists.postgresql.org; Fri, 11 Jul 2025 00:12:09 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1ua1N0-006fDv-13 for pgsql-hackers@postgresql.org; Fri, 11 Jul 2025 00:12:07 +0000 Received: from [192.168.11.9] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id 3AFF661BB7; Fri, 11 Jul 2025 09:12:03 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Fri, 11 Jul 2025 09:12:02 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_dump --with-* options Content-Language: en-US To: Jeff Davis , Robert Haas , Nathan Bossart Cc: Peter Eisentraut , pgsql-hackers References: <7cc52488-f876-4ad3-affd-6e4b0ef0cb09@eisentraut.org> <7bf0246542713d80f12c738c1d365d1365750c18.camel@j-davis.com> <5e398522803da9bf3f9fc33ca43084ec21ab0fcd.camel@j-davis.com> <031558c60e84362898922caa6a90587e7fdf2a57.camel@j-davis.com> <3cc4f166-0b58-47e2-a03c-7c2873d62b14@oss.nttdata.com> From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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: >> >> =C2=A0=C2=A0=C2=A0=C2=A0 * Keep: --schema-only, --data-only, --statis= tics-only, --no- >> schema, --no-data, -and -statistics >> =C2=A0=C2=A0=C2=A0=C2=A0 * Remove: --no-statistics, --with-schema, an= d --with-data >=20 > ... >=20 >> For pg_restore, I believe there's agreement to restore statistics >> by default if they exist in the archive. So: >> >> =C2=A0=C2=A0=C2=A0=C2=A0 * Keep: --schema-only, --data-only, --statis= tics-only, --no- >> schema, --no-data, and --no-statistics >> =C2=A0=C2=A0=C2=A0=C2=A0 * Remove: --with-schema, --with-data, and --= statistics >=20 > 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, --=20 Fujii Masao NTT DATA Japan Corporation