FROM typeoids
WHERE atttypid = typeoids.typoid;
-UPDATE pg_catalog.pg_index SET indcollation[0] = 100
+-- Updating the index indcollations is particularly tedious, but since we
+-- don't currently allow SQL assignment to individual elements of oidvectors,
+-- there's little choice.
+
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, '^0', '100')::pg_catalog.oidvector
WHERE indclass[0] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[1] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[1] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[2] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+ \\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[2] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[3] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+ \\d+ \\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[3] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[4] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+ \\d+ \\d+ \\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[4] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[5] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+ \\d+ \\d+ \\d+ \\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[5] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[6] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+ \\d+ \\d+ \\d+ \\d+ \\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[6] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION
WHERE opcintype = typeoids.typoid
);
-UPDATE pg_catalog.pg_index SET indcollation[7] = 100
+UPDATE pg_catalog.pg_index SET indcollation =
+ pg_catalog.regexp_replace(indcollation::pg_catalog.text, E'^(\\d+ \\d+ \\d+ \\d+ \\d+ \\d+ \\d+) 0', E'\\1 100')::pg_catalog.oidvector
WHERE indclass[7] IN (
WITH RECURSIVE typeoids(typoid) AS
( SELECT 'citext'::pg_catalog.regtype UNION