Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osjWI-0001Lp-CX for pgsql-general@arkaria.postgresql.org; Wed, 09 Nov 2022 11:45:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1osjWG-0004kA-2L for pgsql-general@arkaria.postgresql.org; Wed, 09 Nov 2022 11:45:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osjWF-0004k0-NO for pgsql-general@lists.postgresql.org; Wed, 09 Nov 2022 11:45:23 +0000 Received: from mout.gmx.net ([212.227.15.15]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osjWD-0004VQ-71 for pgsql-general@lists.postgresql.org; Wed, 09 Nov 2022 11:45:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1667994319; bh=MyJPbgsXjumcN5LIiwcgrLqOibAjBuW6ND47BekzclA=; h=X-UI-Sender-Class:Date:From:To:Subject; b=TOF9S5fRntHErCijr65ZfTihPgbJ4vGa8FYDvenl9GPLPlUmyx37TVrWQWpdYT/vu Dpc8NFs6s54r5vfItht3yIYwuBox/emnUfE2SG/SLVZeu70cptJYjQX6NDZwWLMW0e mde4KLzsFOrJM6A6ayMHvPPrjFujxdzFijOe9zh060j12aN9+ZXIatKDdmq5jeed+q aOBuYjcBiRV9xK7RtOE5LERHU/phyTnzxgr6OnhdtE22Fe/u+/pUtCoPflLdQ5vj1j TgqIB9x0hXDzxfuVDVpDH1JZSY0VmyBXfNWW+GT+KJfaqGtn72SeYy3gtcqnXI4wfk Ae8tE1f7N5lWw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from hermes ([84.190.239.134]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhlGk-1pWAwR0GLw-00ds1C for ; Wed, 09 Nov 2022 12:45:19 +0100 Received: from ncq by hermes with local (Exim 4.94.2) (envelope-from ) id 1osjW9-0000oQ-Lt for pgsql-general@lists.postgresql.org; Wed, 09 Nov 2022 12:45:17 +0100 Date: Wed, 9 Nov 2022 12:45:17 +0100 From: Karsten Hilbert To: pgsql-general@lists.postgresql.org Subject: Q: documentation improvement re collation version mismatch Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:7tBEKlkhzG8/CNTrsYP5A7GMOOd2XM/DmYchcSll5gEWXDRAQ1L cQUrFU+m3vDk8lBFCrgJLgWe6IaJnQZ12/LyC1QwCerqcuO3D7wzC8+YBkwo4PHNPCOs3TO qgAMd+CHrrfArYmcQrct8fFhAMWoeWMIXJB8xfovCzhhzIZ4EnwYxPrajoUs8bAoVByVSiF 7HcsGf9hbrRa1tbdfRJbw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:cQGXyWxsJ64=;Dv034A9MxEEUD9cDKWCD/QDFv7l Q6P+XgVHwY9p1EdZuV32kw5LX1gV1xNmsyX+Mc1W0bM9PyCmZkEOzM/uX3l2QlajOL4Rrt50h rsk4WiMhSaU+S96fv8m+uCl515q4zlimHJmX2/X3Eo8v6OFuMb575hi5Lf/9QyFBOzgf6L713 Zdc6Xccw9On76BT2s/Wvs6s+l8hCAOfvAkOBf2L64iXJUTffWtX4d2FDEY8nmurLgYq1YgwqQ cXq4vYHhjgB4W1WBObaTZBJfeKfHD8aQuabqkziSE4uWp38w7fXXMg1Fe83bnDaxrSuUZ3kYE 3nJcMXEugDz8aoARngT48STtW+euF/mTuTRxRlYpAM2gwzba6YDbQ3frlEH7Yejjm5zO25+Uu h3RAOd84+NSjMhw5Q8702XDXwm+IL07FmBLUhu18/inJMRwuwxODzICzyDxr0hc4MsnK7bKoq hT4T2Oqv5jdzHZro+RpscXRgSPkRqdU44hs59d8T4k5/JnEkGHVq5KiSvEThDoGNi18ftgL2d LeGdPd511r1MxDekk2PBRNtJeCKG1dgP4zrIXik7Hf3UXM7+vt61klNyD5phqDsxnUI22ZSCs AXrRvjJzwg2SQdejhvG/wKOBQqGyvyd1eX0WX6EBtmjB7U+d4vI8PvIXBajt6eUfH673y5ohQ EM0l9cGhlbiBUQfKZG2jKPRUat6NqmaVQZ/XQuP0fxz9CX93Gv5Z3bj/JThBi3xqXm0qVDrs2 /6rs0oXLZXk5fIeNPZ2bKg3Ld/g2lsnKP/oPcCytD8jXQYkjzCOUTC/6Z//zh+b0tqH/tJrlw dgGe43e1X/4aX7LcqWHvYkoxmT5AQVFgtNB3FabZgkZeI2vFfZ2GDwifFm3J1XAp4EUOh67GX h50shO35RcCpPtL2cnu+u2RWmIktxuEj2JPpiELjdLu2VMVlHZCpBUVLSzz8UUqmojchMpPwB +uYSRtlm1/ohKX0fbPvVJkyNUoA= Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dear all, 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 "Collatio= n", pg_describe_object(classid, objid, objsubid) AS "Object" FROM pg_depend d JOIN pg_collation c ON refclassid =3D 'pg_collation'::regclass AND refobjid =3D 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). Now, there is a line For the database default collation, there is an analogous command ALTER DATABASE ... REFRESH COLLATION VERSION. right above that query but the query comment does not really make it clear that the database default collation is _not_ identified to be in mismatch, if so. IOW, the database default collation may still need to be refreshed even if the query does not return any rows. Perhaps this query (taken from the net) SELECT -- get collation-change endangered indices indrelid::regclass::text, indexrelid::regclass::text, collname, pg_get_indexdef(indexrelid) FROM ( SELECT indexrelid, indrelid, indcollation[i] coll FROM pg_index, generate_subscripts(indcollation, 1) g(i) ) s JOIN pg_collation c ON coll=3Dc.oid WHERE collprovider IN ('d', 'c') AND collname NOT IN ('C', 'POSIX'); could be added to the paragraph (or it could be folded into the first query by a UNION or some such) ? Or perhaps one could move the "ALTER DATABASE ... REFRESH ..." hint _below_ the query paragraph and add "Note: you may need to refresh the default collation even if the query above does not show any objects directly affected by a collation version change" ? Thanks for considering. Best, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B