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
Revert per-index collation version tracking feature.
Design problems were discovered in the handling of composite types and
record types that would cause some relevant versions not to be recorded.
Misgivings were also expressed about the use of the pg_depend catalog
for this purpose. We're out of time for this release so we'll revert
and try again.
Commits reverted:
1bf946b: Doc: Document known problem with Windows collation versions.
cf00200: Remove no-longer-relevant test case.
ef387be: Fix bogus collation-version-recording logic.
0fb0a05: Hide internal error for pg_collation_actual_version(<bad OID>).
ff94205: Suppress "warning: variable 'collcollate' set but not used".
d50e3b1: Fix assertion in collation version lookup.
f24b156: Rethink extraction of collation dependencies.
257836a: Track collation versions for indexes.
cd6f479: Add pg_depend.refobjversion.
7d1297d: Remove pg_collation.collversion.
Discussion: https://postgr.es/m/CA%2BhUKGLhj5t1fcjqAu8iD9B3ixJtsTNqyCCD4V0aTO9kAKAjjA%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)
Copy file name to clipboardExpand all lines: doc/src/sgml/ref/alter_index.sgml
-15
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,6 @@ ALTER INDEX [ IF EXISTS ] <replaceable class="parameter">name</replaceable> RENA
25
25
ALTER INDEX [ IF EXISTS ] <replaceable class="parameter">name</replaceable> SET TABLESPACE <replaceable class="parameter">tablespace_name</replaceable>
26
26
ALTER INDEX <replaceable class="parameter">name</replaceable> ATTACH PARTITION <replaceable class="parameter">index_name</replaceable>
27
27
ALTER INDEX <replaceable class="parameter">name</replaceable> [ NO ] DEPENDS ON EXTENSION <replaceable class="parameter">extension_name</replaceable>
28
-
ALTER INDEX <replaceable class="parameter">name</replaceable> ALTER COLLATION <replaceable class="parameter">collation_name</replaceable> REFRESH VERSION
29
28
ALTER INDEX [ IF EXISTS ] <replaceable class="parameter">name</replaceable> SET ( <replaceable class="parameter">storage_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )
30
29
ALTER INDEX [ IF EXISTS ] <replaceable class="parameter">name</replaceable> RESET ( <replaceable class="parameter">storage_parameter</replaceable> [, ... ] )
31
30
ALTER INDEX [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ALTER [ COLUMN ] <replaceable class="parameter">column_number</replaceable>
@@ -113,20 +112,6 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
0 commit comments