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

From Tom Lane
Subject Re: Statistics Import and Export
Date
Msg-id 1468522.1740425653@sss.pgh.pa.us
Whole thread Raw
In response to Re: Statistics Import and Export  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> We certainly want attnames for tables to keep it working reasonably
> well for cases where the user might be doing something more interesting
> than a binary upgrade, as you point out. But attribute numbers for
> indexes seem much more reliable: an index with a different attribute
> order is a fundamentally different index.

Right.  We went through pretty much this reasoning, as I recall,
when we invented ALTER INDEX ... SET STATISTICS.  The original
version used a column name like ALTER TABLE did, and we ran into
exactly the present problem that the names aren't too stable across
dump/restore, and we decided that index column numbers would do
instead.  You can't add or drop a column of an index, nor redefine it
meaningfully, except by dropping the whole index which will make any
associated stats go away.

The draft patch I posted allows callers to use attname or attnum
at their option, because I didn't see a reason to restrict that.
But I envisioned that pg_dump would always use attname for table
columns and attnum for index columns.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Restrict copying of invalidated replication slots
Next
From: Tom Lane
Date:
Subject: Re: Statistics Import and Export