Hello,
Now that we have the infrastructure to track indexes that might be corrupted
due to changes in collation libraries, I think it would be a good idea to offer
an easy way for users to reindex all indexes that might be corrupted.
I'm attaching a POC patch as a discussion basis. It implements a new
"COLLATION" option to reindex, with "not_current" being the only accepted
value. Note that I didn't spent too much efforts on the grammar part yet.
So for instance you can do:
REINDEX (COLLATION 'not_current') DATABASE mydb;
The filter is also implemented so that you could cumulate multiple filters, so
it could be easy to add more filtering, for instance:
REINDEX (COLLATION 'libc', COLLATION 'not_current') DATABASE mydb;
to only rebuild indexes depending on outdated libc collations, or
REINDEX (COLLATION 'libc', VERSION 'X.Y') DATABASE mydb;
to only rebuild indexes depending on a specific version of libc.