pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: David Rowley <dgrowleyml@gmail.com>
To: Jeff Davis <jdavis@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Transfer statistics during pg_upgrade.
Date: Tue, 08 Apr 2025 09:42:29 -0700
Message-ID: <cfd360dda6e13a47c5ce2baf538fe697fcceb947.camel@j-davis.com> (raw)
In-Reply-To: <CAApHDvow5dz1=p1QNb+BQV4eaA75j6qmmhpi9j2yFzwcd4pE3Q@mail.gmail.com>
References: <E1tl2sF-000HZG-2w@gemulon.postgresql.org>
	<CAApHDvow5dz1=p1QNb+BQV4eaA75j6qmmhpi9j2yFzwcd4pE3Q@mail.gmail.com>

On Tue, 2025-04-08 at 17:24 +1200, David Rowley wrote:
> I was surprised to see when I did pg_dump -T just_this_table that I
> also got statistics data for all tables in the database.

-T means "exclude this pattern"

I tried a few basic variations and they seemed to do what I expected:

   CREATE TABLE mytable1(i INT);
   INSERT INTO mytable1 VALUES(1);
   CREATE TABLE mytable2(i INT);
   INSERT INTO mytable2 VALUES(2);
   CREATE TABLE mytable3(i INT);
   INSERT INTO mytable3 VALUES(3);
   ANALYZE;

   $ ./bin/pg_dump -t mytable1 postgres | grep "Name: mytable"
   -- Name: mytable1; Type: TABLE; Schema: public; Owner: jdavis
   -- Data for Name: mytable1; Type: TABLE DATA; Schema: ...
   -- Statistics for Name: mytable1; Type: STATISTICS DATA; ...

   $ ./bin/pg_dump -T mytable1 postgres | grep "Name: mytable"
   -- Name: mytable2; Type: TABLE; Schema: public; Owner: jdavis
   -- Name: mytable3; Type: TABLE; Schema: public; Owner: jdavis
   -- Data for Name: mytable2; Type: TABLE DATA; Schema: ...
   -- Data for Name: mytable3; Type: TABLE DATA; Schema: ...
   -- Statistics for Name: mytable2; Type: STATISTICS DATA; ...
   -- Statistics for Name: mytable3; Type: STATISTICS DATA; ...

If you still see a problem, please let me know.

Regards,
	Jeff Davis






view thread (4+ messages)

Message-ID: <cfd360dda6e13a47c5ce2baf538fe697fcceb947.camel@j-davis.com>
Permalink:  ../cfd360dda6e13a47c5ce2baf538fe697fcceb947.camel@j-davis.com/
Also on:    postgresql.org/message-id/cfd360dda6e13a47c5ce2baf538fe697fcceb947.camel@j-davis.com

 · 

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-committers@postgresql.org
  Cc: pgsql@j-davis.com, dgrowleyml@gmail.com, jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Transfer statistics during pg_upgrade.
  In-Reply-To: <cfd360dda6e13a47c5ce2baf538fe697fcceb947.camel@j-davis.com>

* 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