Re: Q: fixing collation version mismatches

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Q: fixing collation version mismatches
Date: 2022-11-13 21:58:37
Message-ID: Y3FojZ4gPMoJuMfx@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Sun, Nov 13, 2022 at 12:46:53PM -0800 schrieb Christophe Pettus:

> > On Nov 13, 2022, at 12:45, Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net> wrote:
> > REINDEX DATABASE db_in_question;
> > ALTER DATABASE db_in_question REFRESH COLLATION VERSION;
> > ALTER COLLATION every_collation_from_pg_collation REFRESH VERSION;
>
> I may be totally off-base here, but shouldn't the REINDEX be the last step?

To my understanding, the REFRESH statements "merely" update
the version information stored in the related objects. They
do not change anything else; and the REINDEX does not
reference them in any way.

I suppose the REINDEX goes first as it does the actual fixing
of now-invalid objects by rebuilding them. After that one is
back to a usable database state, even if left with pesky
(albeit harmless) warnings on version mismatches -- which to
get rid of one runs the REFRESH statements.

Or so my understanding...

Which is why my question still stands: does the above
three-strikes operation safely take care of any collation
issues that may currently exist in a database ?

Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2022-11-14 05:10:03 Re: Q: fixing collation version mismatches
Previous Message Peter Geoghegan 2022-11-13 21:33:10 Re: ON CONFLICT and WHERE