agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: carl.witt@knime.com
Subject: Query to identify all collations in the current database that need to be refreshed
Date: Tue, 10 Jun 2025 11:30:43 +0000
Message-ID: <174955504341.789.12003037401879382460@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/sql-altercollation.html
Description:

On the alter collation docs [1], it 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;
```
This seems to be a bit optimistic, since in my postgres instance, the
`default` collation has `collversion` set to `NULL` which would not pass the
comparison. In addition, dependencies to `default` do not seem to be
encoded, as
```
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
```
returns an empty row set. It seems like the description of the query is
inaccurate.
[1]
https://www.postgresql.org/docs/current/sql-altercollation.html#SQL-ALTERCOLLATION-NOTES


Message-ID: <174955504341.789.12003037401879382460@wrigleys.postgresql.org>
Permalink:  ../174955504341.789.12003037401879382460@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/174955504341.789.12003037401879382460@wrigleys.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, carl.witt@knime.com
  Subject: Re: Query to identify all collations in the current database that need to be refreshed
  In-Reply-To: <174955504341.789.12003037401879382460@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox