public inbox for [email protected]  
help / color / mirror / Atom feed
From: Magnus Hagander <[email protected]>
To: Jeff Davis <[email protected]>
Cc: Greg Sabino Mullane <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Corey Huinker <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Matthias van de Meent <[email protected]>
Cc: Stephen Frost <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: [email protected]
Cc: jian he <[email protected]>
Subject: Re: Statistics Import and Export
Date: Sun, 2 Mar 2025 15:38:07 +0100
Message-ID: <CABUevEwS1f+sJ8D8A6=9tv214Fdk=Li-uBffz_Rbov7WWA9ecA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CADkLM=f0a43aTd88xW4xCFayEF25g-7hTrHX_WhV40HyocsUGg@mail.gmail.com>
	<[email protected]>
	<CADkLM=ckXu5wzSQZ3Y_fvAaL8rZ+upZdSecBLf5FCTMj7M6T-A@mail.gmail.com>
	<[email protected]>
	<CADkLM=dRMC6t8gp9GVf6y6E_r5EChQjMAAh_vPyih_zMiq0zvA@mail.gmail.com>
	<y2d36zf6pl3n6ni6e4ctblu3a5iazi2dycknq53h2mjvp7lto4@hhww3h2qgdrw>
	<[email protected]>
	<CADkLM=eWSv2z_DVB=psfwHitq7DbFJQaP9A46R27eARC-4OYtQ@mail.gmail.com>
	<cpdanvzykcb5o64rmapkx6n5gjypoce3y52hff7ocxupgpbxu4@53jmlyvukijo>
	<CADkLM=dX67xer59tVYMCQZ+pHAT2sCyyrUDzeDCdW_TdxqwOgA@mail.gmail.com>
	<curtrasm6ylt7es2ukfuals2mh5an72yzxgvyel65mw3ere7qs@nw6m4ffpo4m3>
	<[email protected]>
	<CACJufxHG9MBQozbJQ4JRBcRbUO+t+sx4qLZX092rS_9b4SR_EA@mail.gmail.com>
	<CAExHW5vf9D+8-a5_BEX3y=2y_xY9hiCxV1=C+FnxDvfprWvkng@mail.gmail.com>
	<[email protected]>
	<CAKAnmmKCgnqcd3x4Z+5yXsY7urpDS6D_NZG7pr=DYD=LHt5X4g@mail.gmail.com>
	<[email protected]>
	<CAKAnmmJyXoVFttrdCz=R-oZnbcJifzSidP9Z2wHO=pU4-AEb0g@mail.gmail.com>
	<[email protected]>

On Sat, Mar 1, 2025 at 9:48 PM Jeff Davis <[email protected]> wrote:

> On Sat, 2025-03-01 at 13:52 -0500, Greg Sabino Mullane wrote:
> > > Can you expand on some of those cases?
> >
> > Certainly. I think one of the problems is that because this patch is
> > solving a pg_upgrade issue, the focus is on the "dump and restore"
> > scenarios. But pg_dump is used for much more than that, especially
> > "dump and examine".
>
> Thank you for going through these examples.
>
> > I just don't think it should be enabled by default for everything
> > using pg_dump. For the record, I would not strongly object to having
> > stats on by default for binary dumps, although I would prefer them
> > off.
>
> I am open to that idea, I just want to get it right, because probably
> whatever the default is in 18 will stay that way.
>
> Also, we will need to think through the set of pg_dump options again. A
> lot of our tools seem to assume that "if it's the default, we don't
> need a way to ask for it explicitly", which makes it a lot harder to
> ever change the default and keep a coherent set of options.
>

That's a good point in general, and definitely something we should think
through, independently of his patch.


> > So why not just expect people to modify their programs to use --no-
> > statistics for cases like this? That's certainly an option, but it's
> > going to break a lot of existing things, and create branching code:
>
> I suggest that we wait a bit to see what additional feedback we get
> early in beta.
>

I definitely thing it should be on by default.

FWIW, I've seen many cases of people using automated tools to verify the
*schema* between two databases. I'd say that's quite common. But they use
pg_dump -s, which I believe is not affected by this one.

I don't think I've ever come across an automated tool to verify the
contents of an entire database this way. That doesn't mean it's not out
there of course, just that it's not so common. The cases I've seen pg_dump
used to verify the contents that's always been in combination with a myriad
of other switches such as include/exclude of specific tables etc, and
adding just one more switch to those seems like a small price to pay for
having the default behaviour be a big improvement for the majority of
usecases.


> Also, anything trained to parse pg_dump output will have to learn
> > about the new SELECT pg_restore_ calls with their multi-line formats
> > (not 100% sure we don't have that anywhere, as things like "SELECT
> > setval" and "SELECT set_config" are single line, but there may be
> > existing things)
>

That's going to be true every time we add something to pg_dump. And for
that matter, anything new to *postgresql*, since surely we'd want pg_dump
to dump objects by default. Any tool that parses the pg_dump output
directly will always have to carefully analyze each new version. And
probably shouldn't be using the plaintext format in the first place - and
if using pg_restore it comes out as it's own type of object, making it easy
to exclude at that level.

--
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;


view thread (170+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Statistics Import and Export
  In-Reply-To: <CABUevEwS1f+sJ8D8A6=9tv214Fdk=Li-uBffz_Rbov7WWA9ecA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox