On Mon, Jun 01, 2020 at 05:39:05PM +0300, Andrey Klychkov wrote:
> I’ve seen on the internet people ask each other about this (when i
> was searching the same not seeing that in the documentation).
Note that indexes and tables can be schema-qualified in a REINDEX
query, so you would need a bit more than the query above, still you
could just wrap that in a plpgsql function that scans pg_class and
pg_index, and issues a set of DROP INDEX commands on each entry. I
have been wondering as well in the past about adding a set of SQL
queries to be able to do the work in a database as if you run into
this issue repeatedly it is annoying. So we could add that on the
reindex page close to the paragraph about the drop of invalid
indexes.
--
Michael