Re: pg_dump --with-* options

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Nathan Bossart <nathandbossart@gmail.com>, Robert Haas <robertmhaas@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>, pgsql@j-davis.com
Date: 2025-06-13T00:39:54Z
Lists: pgsql-hackers

On 2025/06/12 23:52, Nathan Bossart wrote:
> On Thu, Jun 12, 2025 at 10:18:56AM -0400, Robert Haas wrote:
>> On Fri, Jun 6, 2025 at 11:40 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>>> On Fri, Jun 06, 2025 at 09:14:32AM +0200, Peter Eisentraut wrote:
>>>> 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.
>>
>> Am I too late to propose ripping this out?
>>
>> I mean, if I look at pg_dump --help and there are options for
>> --with-broccoli and --without-mushrooms, I know that the defaults are
>> no brocooli, yes mushrooms, and I know which options I need to specify
>> to get the behavior that I want, whatever that happens to be. If all
>> options exist in both forms, it's a lot more confusing. Maybe there's
>> some issue of cross-version compatibility here that justifies this
>> complexity, but I don't see what it would be. I would think
>> --with-data has always been the default and always will be, so we just
>> don't need --with-data for anything. But maybe I'm confused.
> 
> If the idea is to remove all options for default behavior, we'd be removing
> --no-statistics, --with-data, and --with-schema at this point.

WFM.

Regarding pg_restore, since --with-statistics is already the default,
we should remove it from pg_restore.

By the way, if we keep --with-statistics in pg_dump, are we planning to
continue using the --with-xxx naming pattern for new options that
specify extra data to dump? I just wondered because pg_dump already has
other naming styles like --sequence-data, --include-foreign-data,
and --large-objects.

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Simplify options in pg_dump and pg_restore.

  2. pg_dump: reject combination of "only" and "with"

  3. Change pg_dump default for statistics export.