Re: pgsql: Transfer statistics during pg_upgrade. - Mailing list pgsql-committers

From Jeff Davis
Subject Re: pgsql: Transfer statistics during pg_upgrade.
Date
Msg-id cfd360dda6e13a47c5ce2baf538fe697fcceb947.camel@j-davis.com
Whole thread Raw
In response to Re: pgsql: Transfer statistics during pg_upgrade.  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-committers
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




pgsql-committers by date:

Previous
From: Nathan Bossart
Date:
Subject: pgsql: Prevent 006_transfer_modes.pl from leaving files behind.
Next
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Make cancel request keys longer