Re: pg_dump --with-* options

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump --with-* options
Date: 2025-06-16 19:35:48
Message-ID: CADkLM=fXSiX4GQ7F6__z+ofGpp0QwwytGP-GNeVQyMhc29bbwQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> I noticed that --statistics (i.e., the current --with-statistics) causes
> statistics to be dumped even when used with --data-only or --schema-only.
> So, as far as I understand, here are the possible combinations of dump
> targets and options:
>

Those should also be mutually exclusive, and I'll write up a patch to add
them to the checks.

>
> schema, data, stats: --statistics
> schema, data: (default)
> schema, stats: --schema-only --statistics
> data, stats: --data-only --statistics
> schema only: --schema-only
> data only: --data-only
> stats only: --statistics-only
>
> This makes me wonder if --no-data and --no-schema are still necessary.
> They were also introduced in v18, but might now be redundant. If so,
> should we consider removing them?
>
> If we do keep them, we could also use --no-schema --statistics to
> dump data and statistics, but I find --data-only --statistics more
> intuitive.
>

I think this is the exact sort of confusion caused by having two of the
three types default to on in all circumstances, and one default to off in
one special circumstance.

Let's keep this simple, and have all three types default to on in all
circumstances.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2025-06-16 19:39:07 Re: Allow pg_dump --statistics-only to dump foreign table statistics?
Previous Message Yan Haibo 2025-06-16 19:20:38 回复: 回复: Fix potential overflow risks from wcscpy and sprintf