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 1uPj7I-00EaC0-Ie for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jun 2025 14:41:20 +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 1uPj7G-00DWgO-CR for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jun 2025 14:41:19 +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 1uPj7G-00DWgG-2y for pgsql-hackers@lists.postgresql.org; Thu, 12 Jun 2025 14:41:18 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uPj7E-001cqu-2v for pgsql-hackers@postgresql.org; Thu, 12 Jun 2025 14:41:17 +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 5AB90609DA; Thu, 12 Jun 2025 23:41:14 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <41f5c07b-cb7b-428b-b9db-9e9db8c9238b@oss.nttdata.com> Date: Thu, 12 Jun 2025 23:41:13 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_dump --with-* options Content-Language: en-US To: Peter Eisentraut , Nathan Bossart Cc: pgsql-hackers , pgsql@j-davis.com References: <7cc52488-f876-4ad3-affd-6e4b0ef0cb09@eisentraut.org> <17f63ecf-679c-4337-817f-908bb159701f@eisentraut.org> From: Fujii Masao In-Reply-To: <17f63ecf-679c-4337-817f-908bb159701f@eisentraut.org> 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/06/12 22:47, Peter Eisentraut wrote: > On 06.06.25 17:39, Nathan Bossart wrote: >> On Fri, Jun 06, 2025 at 09:14:32AM +0200, Peter Eisentraut wrote: >>> We have >>> >>> =C2=A0=C2=A0 -a, --data-only=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dump only = the data, not the schema or statistics >>> =C2=A0=C2=A0 --no-data=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 do not dump data >>> =C2=A0=C2=A0 --with-data=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 dump the data=C2=A0 # this one is new >>> >>> (and there is also --section=3Ddata), and then three analogous option= s for >>> "schema" and "statistics". >>> >>> What is the purpose of the --with-data option?=C2=A0 Dumping the data= is the >>> default.=C2=A0 Is this to override an earlier --no-data option? >> >> I believe the idea is that these will allow folks to be explicit about= what >> they want instead of needing to understand the defaults for every >> component. >=20 > I get that idea, but we really need some more documentation for this, I= think.=C2=A0 So far I could only guess how this is supposed to be used, = and I also happened to guess wrong. >=20 > My initial guess was that --with-data can override --no-data.=C2=A0 Tha= t would have been pretty standard "last option wins" behavior.=C2=A0 But = pg_dump rejects that.=C2=A0 Personally, I think that is kind of wrong. >=20 > But you can use --with-data to override, say, --schema-only.=C2=A0 That= also seems kind of wrong to me, but anyway. While testing pg_dump --with-* in relation to bug #18952 [1], I also ran into this behavior. It was surprising, as I expected pg_dump to reject that combination of options. The current behavior seems confusing. Regards, [1] https://postgr.es/m/18952-be40a620f8b1e755@postgresql.org --=20 Fujii Masao NTT DATA Japan Corporation