Add --now option ('do it').  Plus small bug fixes.
Add --now option ('do it').  Plus small bug fixes.

If you use --now, reindex now.  If not, just print out what it would
do.

If you have an index that depends on more than one collation and more
than one of them changed (ie checksum different), don't rebuild the
index multiple times.

If the path or modified time change but the checksum doesn't, then
record those changes (but don't reindex).

Compute all the indexes up front, before doing any reindexing work.
That way, if the locales get updated *while we're running* (for
example, rebuilding an index that takes a few hours with --now
specified), then at least we'll notice next time you run the script
(rather than letting it slip through the cracks).  Update all the
indexes in the database at the end.  (In theory you should rerun this
script until it finds nothing to do in that scenario).

macdice/check_pg_collations