reindex concurrently and two toast indexes
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Sergei Kornilov <sk@zsrv.org>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Michael Paquier <michael.paquier@gmail.com>, Andreas Karlsson <andreas@proxel.se>, pgsql-hackers@postgresql.org
Date: 2020-02-16T19:08:35Z
Lists: pgsql-hackers
Forking old, long thread: https://www.postgresql.org/message-id/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net On Fri, Jan 04, 2019 at 03:18:06PM +0300, Sergei Kornilov wrote: > About reindex invalid indexes - i found one good question in archives [1]: how about toast indexes? > I check it now, i am able drop invalid toast index, but i can not drop reduntant valid index. > Reproduce: > session 1: begin; select from test_toast ... for update; > session 2: reindex table CONCURRENTLY test_toast ; > session 2: interrupt by ctrl+C > session 1: commit > session 2: reindex table test_toast ; > and now we have two toast indexes. DROP INDEX is able to remove only invalid ones. Valid index gives "ERROR: permission denied: "pg_toast_16426_index_ccnew" is a system catalog" > [1]: https://www.postgresql.org/message-id/CAB7nPqT%2B6igqbUb59y04NEgHoBeUGYteuUr89AKnLTFNdB8Hyw%40mail.gmail.com It looks like this was never addressed. I noticed a ccnew toast index sitting around since October - what do I do with it ? ts=# DROP INDEX pg_toast.pg_toast_463881620_index_ccnew; ERROR: permission denied: "pg_toast_463881620_index_ccnew" is a system catalog -- Justin
Commits
-
Prevent reindex of invalid indexes on TOAST tables
- 8bca5f93547c 12.3 landed
- 61d7c7bce368 13.0 landed
-
Fix more issues with dependency handling at swap phase of REINDEX CONCURRENTLY
- 26876127be2c 12.3 landed
- fbcf0871123b 13.0 landed