Re: AW: No result when selecting attstattarget from pg_attribute

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: AW: No result when selecting attstattarget from pg_attribute
Дата
Msg-id cb254ce872c8e01d42a54ef2dcb2f4c90459c679.camel@cybertec.at
обсуждение исходный текст
Ответ на AW: No result when selecting attstattarget from pg_attribute  ("William Sescu (Suva)" <william.sescu@suva.ch>)
Список pgsql-admin
On Thu, 2019-11-28 at 15:14 +0000, William Sescu (Suva) wrote:
> Thank you Tom for clarification. However, in regards of pg_upgrade, which does not transfer statistics, how do I
know
> how to create the "CREATE STATISTICS" on the new PostgreSQL version?
> 
> e.g. Developers created a whole bunch of "CREATE STATISTICS" on all kind of tables, which ends up in pg_statistic_ext
view.
> 
> select * from pg_statistic_ext;
>  stxrelid | stxname | stxnamespace | stxowner | stxkeys | stxkind | stxndistinct |   stxdependencies
> ----------+---------+--------------+----------+---------+---------+--------------+----------------------
>     35600 | s1      |        16579 |    16569 | 1 2     | {f}     |              | {"1 => 2": 1.000000}
> 
> Is there any way how I can translate the view entries into into a SQL again?
> 
> CREATE STATISTICS s1 (dependencies) ON a, b FROM t1;

You are worrying without need.

While the actual statistics won't be upgraded, the *definition* for
extended statistics will be.  So your CREATE STATISTICS won't vanish
during an upgrade.

You'll have to ANALYZE after upgrading so that PostgreSQL collects the
extended statistics.

Extended statistics are stored in the "pg_statistic_ext" catalog.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




В списке pgsql-admin по дате отправления:

Предыдущее
От: "William Sescu (Suva)"
Дата:
Сообщение: AW: No result when selecting attstattarget from pg_attribute
Следующее
От: Tom Lane
Дата:
Сообщение: Re: AW: No result when selecting attstattarget from pg_attribute