Re: Statistics Import and Export - Mailing list pgsql-hackers

From Robert Treat
Subject Re: Statistics Import and Export
Date
Msg-id CABV9wwP_ajEbLhCzfCO2Sy0180AshYwQFViys=QhyZA7sW2_qw@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Statistics Import and Export
List pgsql-hackers
On Fri, Mar 7, 2025 at 1:41 PM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Fri, 2025-03-07 at 12:41 -0500, Robert Treat wrote:
> > Ugh... this feels like a bit of the combinatorial explosion,
> > especially if we ever need to add another option.
>
> Not quite that bad, because ideally the yes/no/only  would not be
> expanding as well. But I agree that it feels like a lot of options.
>
> > I wonder if it would
> > be possible to do something simple like just providing
> > "--include={schema|data|stats}" where you specify only what you want,
> > and leave out what you don't.
>
> Can you explain the idea in a bit more detail? Does --
> include=statistics mean include statistics also or statistics only? Can
> you explicitly request that data be included but rely on the default
> for statistics? What options would it override or conflict with?
>

There might be some variability depending on the default behavior, but
if we assume that default means "output everything" (which is the v17
behavior), then use of --include would mean to only include items that
are listed, so:

if you want everything --include=schema,data,statistics (presumably
redundant with the default behavior)
if you want schema only --include=schema
if you want "everything except schema" --include=data,statistics

So it's pretty easy to extrapolate data only or statistics only, and
pretty easy to work up any combo of 2 of the 3.

And if someday, for example, there is ever agreement on including role
information with normal pg_dump, you add "roles" as an option to be
parsed via --include without having to create any new flags.


Robert Treat
https://xzilla.net



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: strange valgrind reports about wrapper_handler on 64-bit arm
Next
From: Jeff Davis
Date:
Subject: Re: Update Unicode data to Unicode 16.0.0