Re: Preserve attstattarget on REINDEX CONCURRENTLY
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ronan Dunklau <ronan@dunklau.fr>, Tomas Vondra <tomas.vondra@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2021-02-10T06:58:05Z
Lists: pgsql-hackers
On Fri, Feb 05, 2021 at 11:17:48AM +0900, Michael Paquier wrote: > Let's copy this data in index_concurrently_swap() instead. The > attached patch does that, and adds a test cheaper than what was > proposed. There is a minor release planned for next week, so I may be > +++ b/src/test/regress/sql/create_index.sql > @@ -1103,6 +1104,13 @@ SELECT starelid::regclass, count(*) FROM pg_statistic WHERE starelid IN ( > 'concur_exprs_index_pred'::regclass, > 'concur_exprs_index_pred_2'::regclass) > GROUP BY starelid ORDER BY starelid::regclass::text; > +-- attstattarget should remain intact > +SELECT attrelid::regclass, attnum, attstattarget > + FROM pg_attribute WHERE attrelid IN ( > + 'concur_exprs_index_expr'::regclass, > + 'concur_exprs_index_pred'::regclass, > + 'concur_exprs_index_pred_2'::regclass) > + ORDER BY 'concur_exprs_index_expr'::regclass::text, attnum; If I'm not wrong, you meant to ORDER BY attrelid::regclass::text, attnum; -- Justin
Commits
-
Fix ORDER BY clause in new regression test of REINDEX CONCURRENTLY
- 5b2945ec0a39 12.7 landed
- c6cd20d91ce9 13.3 landed
- 4f4726005082 14.0 landed
-
Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY
- 85edb1f2615d 12.7 landed
- 849383138581 13.3 landed
- bd1208098029 14.0 landed