Aw: Re: Q: documentation improvement re collation version mismatch

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Aw: Re: Q: documentation improvement re collation version mismatch
Date: 2022-11-10 10:47:01
Message-ID: trinity-091da3f5-fcb3-4da4-ac47-086a2509df51-1668077221841@3c-app-gmx-bs14
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks, Julien, for your explanation.

> > regarding changed collation versions this
> >
> > https://www.postgresql.org/docs/devel/sql-altercollation.html
> >
> > says:
> >
> > The following query can be used to identify all
> > collations in the current database that need to be
> > refreshed and the objects that depend on them:
> >
> > SELECT pg_describe_object(refclassid, refobjid, refobjsubid) AS "Collation",
> > pg_describe_object(classid, objid, objsubid) AS "Object"
> > FROM pg_depend d JOIN pg_collation c
> > ON refclassid = 'pg_collation'::regclass AND refobjid = c.oid
> > WHERE c.collversion <> pg_collation_actual_version(c.oid)
> > ORDER BY 1, 2;
> >
> > I feel the result of that query can be slightly surprising
> > because it does not return (to my testing) any objects
> > depending on the database default collation, nor the database
> > itself (as per a collation version mismatch in pg_database).
>
> Indeed. The default collation is "pinned", so we don't record any dependency
> on it.

Indirectly we do, don't we ? Or else

> > WHERE
> > collprovider IN ('d', 'c')

would not make much sense, right ?

The comment above the query in the official documentation is rather assertive
(even if may true to the letter) and may warrant some more cautionary
wording ? Added, perhaps, some variation of this:

> For now, the only safe way to go is either reindex everything, or everything
> except some safe cases (non-partial indexes on plain-non-collatable datatypes
> only).

Best,
Karsten

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2022-11-10 11:36:21 Re: Q: documentation improvement re collation version mismatch
Previous Message 黄宁 2022-11-10 09:02:21 change analyze function for a array type