pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Peter Eisentraut <peter@eisentraut.org>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: pgsql@j-davis.com
Subject: Re: pg_dump --with-* options
Date: Thu, 12 Jun 2025 23:41:13 +0900
Message-ID: <41f5c07b-cb7b-428b-b9db-9e9db8c9238b@oss.nttdata.com> (raw)
In-Reply-To: <17f63ecf-679c-4337-817f-908bb159701f@eisentraut.org>
References: <7cc52488-f876-4ad3-affd-6e4b0ef0cb09@eisentraut.org>
	<aEMLzPQtjRbj2R7X@nathan>
	<17f63ecf-679c-4337-817f-908bb159701f@eisentraut.org>



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
>>>
>>>    -a, --data-only      dump only the data, not the schema or statistics
>>>    --no-data            do not dump data
>>>    --with-data          dump the data  # this one is new
>>>
>>> (and there is also --section=data), and then three analogous options for
>>> "schema" and "statistics".
>>>
>>> What is the purpose of the --with-data option?  Dumping the data is the
>>> default.  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.
> 
> I get that idea, but we really need some more documentation for this, I think.  So far I could only guess how this is supposed to be used, and I also happened to guess wrong.
> 
> My initial guess was that --with-data can override --no-data.  That would have been pretty standard "last option wins" behavior.  But pg_dump rejects that.  Personally, I think that is kind of wrong.
> 
> But you can use --with-data to override, say, --schema-only.  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

-- 
Fujii Masao
NTT DATA Japan Corporation






view thread (72+ messages)  latest in thread

Message-ID: <41f5c07b-cb7b-428b-b9db-9e9db8c9238b@oss.nttdata.com>
Permalink:  ../41f5c07b-cb7b-428b-b9db-9e9db8c9238b@oss.nttdata.com/
Also on:    postgresql.org/message-id/41f5c07b-cb7b-428b-b9db-9e9db8c9238b@oss.nttdata.com

 · 

reply

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, peter@eisentraut.org, nathandbossart@gmail.com, pgsql@j-davis.com
  Subject: Re: pg_dump --with-* options
  In-Reply-To: <41f5c07b-cb7b-428b-b9db-9e9db8c9238b@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