pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Corey Huinker <corey.huinker@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Statistics Import and Export
Date: Wed, 27 Dec 2023 22:10:25 -0500
Message-ID: <2788275.1703733025@sss.pgh.pa.us> (raw)
In-Reply-To: <CADkLM=ff8BsPCvigT+xooPPBy4mCyu6pGdR=_e6ew=gR7bpCGA@mail.gmail.com>
References: <CADkLM=cB0rF3p_FuWRTMSV0983ihTRpsH+OCpNyiqE7Wk0vUWA@mail.gmail.com>
	<CAExHW5uRNe856LPYH1eZFyeASv4Xs4-9d1Gqj+rzS+3StVGLxQ@mail.gmail.com>
	<CADkLM=c_iuAN19_94ikG5VeR_Z3LDkR6fKyeOz=ZKr44qweYjg@mail.gmail.com>
	<CADkLM=dTHVSrcGBAstjshoZBXKJgWjzN3Vj53KQ9fORqvkaN5Q@mail.gmail.com>
	<f0930823-d44b-21df-d718-ee3c657d9087@enterprisedb.com>
	<CADkLM=cx-XM-PTscj+uDi24x3_vDpYMOjfHgw9CFt_ad5poc0A@mail.gmail.com>
	<76596388-6fe6-0baf-351d-734458a46d76@enterprisedb.com>
	<CADkLM=frTx5DocOpyhRHL4r_LKvP315cNA-5+0UVqGM=7GKd9A@mail.gmail.com>
	<4268d862-7784-f76f-d7f1-359b0b4db67c@enterprisedb.com>
	<ZYsYMqukg97HdB7u@momjian.us>
	<2090613.1703618344@sss.pgh.pa.us>
	<4e49c72e-f8a5-de1a-4ef4-36529bee1d65@enterprisedb.com>
	<CADkLM=ff8BsPCvigT+xooPPBy4mCyu6pGdR=_e6ew=gR7bpCGA@mail.gmail.com>

Corey Huinker <corey.huinker@gmail.com> writes:
> Export functions was my original plan, for simplicity, maintenance, etc,
> but it seemed like I'd be adding quite a few functions, so the one view
> made more sense for an initial version. Also, I knew that pg_dump or some
> other stats exporter would have to inline the guts of those functions into
> queries for older versions, and adapting a view definition seemed more
> straightforward for the reader than function definitions.

Hmm, I'm not sure we are talking about the same thing at all.

What I am proposing is *import* functions.  I didn't say anything about
how pg_dump obtains the data it prints; however, I would advocate that
we keep that part as simple as possible.  You cannot expect export
functionality to know the requirements of future server versions,
so I don't think it's useful to put much intelligence there.

So I think pg_dump should produce a pretty literal representation of
what it finds in the source server's catalog, and then rely on the
import functions in the destination server to make sense of that
and do whatever slicing-n-dicing is required.

That being the case, I don't see a lot of value in a view -- especially
not given the requirement to dump from older server versions.
(Conceivably we could just say that we won't dump stats from server
versions predating the introduction of this feature, but that's hardly
a restriction that supports doing this via a view.)

			regards, tom lane





view thread (543+ messages)  latest in thread

Message-ID: <2788275.1703733025@sss.pgh.pa.us>
Permalink:  ../2788275.1703733025@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2788275.1703733025@sss.pgh.pa.us

 · 

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: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, corey.huinker@gmail.com, tomas.vondra@enterprisedb.com, bruce@momjian.us, ashutosh.bapat.oss@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Statistics Import and Export
  In-Reply-To: <2788275.1703733025@sss.pgh.pa.us>

* 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