You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This model couldn't be extended to cover the default collation, and
didn't have any information about the affected database objects when the
version changed. Remove, in preparation for a follow-up commit that
will add a new mechanism.
Author: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Discussion: https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%40mail.gmail.com
When using collations provided by the ICU library, the ICU-specific version
108
-
of the collator is recorded in the system catalog when the collation object
109
-
is created. When the collation is used, the current version is
110
-
checked against the recorded version, and a warning is issued when there is
111
-
a mismatch, for example:
112
-
<screen>
113
-
WARNING: collation "xx-x-icu" has version mismatch
114
-
DETAIL: The collation in the database was created using version 1.2.3.4, but the operating system provides version 2.3.4.5.
115
-
HINT: Rebuild all objects affected by this collation and run ALTER COLLATION pg_catalog."xx-x-icu" REFRESH VERSION, or build PostgreSQL with the right library version.
116
-
</screen>
117
-
A change in collation definitions can lead to corrupt indexes and other
118
-
problems because the database system relies on stored objects having a
119
-
certain sort order. Generally, this should be avoided, but it can happen
120
-
in legitimate circumstances, such as when
121
-
using <command>pg_upgrade</command> to upgrade to server binaries linked
122
-
with a newer version of ICU. When this happens, all objects depending on
123
-
the collation should be rebuilt, for example,
124
-
using <command>REINDEX</command>. When that is done, the collation version
125
-
can be refreshed using the command <literal>ALTER COLLATION ... REFRESH
126
-
VERSION</literal>. This will update the system catalog to record the
127
-
current collator version and will make the warning go away. Note that this
128
-
does not actually check whether all affected objects have been rebuilt
129
-
correctly.
130
-
</para>
131
-
<para>
132
-
When using collations provided by <literal>libc</literal> and
133
-
<productname>PostgreSQL</productname> was built with the GNU C library, the
134
-
C library's version is used as a collation version. Since collation
135
-
definitions typically change only with GNU C library releases, this provides
136
-
some defense against corruption, but it is not completely reliable.
137
-
</para>
138
-
<para>
139
-
Currently, there is no version tracking for the database default collation.
140
-
</para>
141
-
142
-
<para>
143
-
The following query can be used to identify all collations in the current
144
-
database that need to be refreshed and the objects that depend on them:
145
-
<programlisting><![CDATA[
146
-
SELECT pg_describe_object(refclassid, refobjid, refobjsubid) AS "Collation",
147
-
pg_describe_object(classid, objid, objsubid) AS "Object"
148
-
FROM pg_depend d JOIN pg_collation c
149
-
ON refclassid = 'pg_collation'::regclass AND refobjid = c.oid
150
-
WHERE c.collversion <> pg_collation_actual_version(c.oid)
0 commit comments