From: Peter Eisentraut <peter@eisentraut.org>
To: Jeff Davis <pgsql@j-davis.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_dump --with-* options
Date: Fri, 13 Jun 2025 07:22:13 +0200
Message-ID: <2ca8a35d-4bba-4529-88c1-3ca92dbc9e87@eisentraut.org> (raw)
In-Reply-To: <8f4dc84b52165fa31402259b2ab45ae7a04dff42.camel@j-davis.com>
References: <7cc52488-f876-4ad3-affd-6e4b0ef0cb09@eisentraut.org>
<aEMLzPQtjRbj2R7X@nathan>
<17f63ecf-679c-4337-817f-908bb159701f@eisentraut.org>
<ad5175ba8abb9caec1fe59187ad7e54d3d24d797.camel@j-davis.com>
<350edd98-7e91-4b63-b393-ba8b681b0799@eisentraut.org>
<8f4dc84b52165fa31402259b2ab45ae7a04dff42.camel@j-davis.com>
On 12.06.25 23:20, Jeff Davis wrote:
> On Thu, 2025-06-12 at 21:16 +0200, Peter Eisentraut wrote:
>>> Do we have other options that are order-sensitive?
>>
>> I think most of them are. For example:
>>
>> psql -p 5432 -p 5433
>> initdb --data-checksums --no-data-checksums
>> postgres --shared-buffers=1GB --shared-buffers=2GB
>
> Interesting. I don't think the "last option wins" model applies to
> other pg_dump options, though. For instance, in PG17:
>
> pg_dump --data-only --schema-only
> pg_dump: error: options -s/--schema-only and -a/--data-only cannot be
> used together
>
> I don't think it's simple to start using "last option wins" behavior
> now. There are probably some combinations of options where it's not
> clear whether a later option is an extra constraint or will override a
> previous option.
It makes sense to raise an error if the specified options cannot be
consolidated in an obvious way. I'd expect
pg_recvlogical --create-slot --drop-slot
to fail, but I'd expect
pg_recvlogical --create-slot --slot=foo --slot=bar
to work.
One of the challenges in the current case is that it is not obvious how
--with-data, --no-data, --data-only etc. are connected. If that were
clearer, then the way these options should combine or conflict would
hopefully follow somewhat naturally.
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: peter@eisentraut.org, pgsql@j-davis.com, nathandbossart@gmail.com
Subject: Re: pg_dump --with-* options
In-Reply-To: <2ca8a35d-4bba-4529-88c1-3ca92dbc9e87@eisentraut.org>
* 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