Skip to content

fix(findings): stop warning on unused drifted collations - #146

Open
lofoneh wants to merge 1 commit into
pgrundev:mainfrom
lofoneh:fix/collation-mismatch-unused-icu
Open

lofoneh wants to merge 1 commit into
pgrundev:mainfrom
lofoneh:fix/collation-mismatch-unused-icu

Conversation

@lofoneh

@lofoneh lofoneh commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #130.

After an ICU upgrade on a libc database, every built-in *-x-icu collation
still records the old version, so collation_version_mismatch warned in every
database and listed all 871 of them. Nothing uses those collations, so nothing
can be out of order.

Now a changed collation only counts if a column, index, partition key or
something in pg_depend uses it. If nothing does, it's one info line that
doesn't affect the exit code. A used one still warns and the database default
is still critical.

One catch: Postgres doesn't record pg_depend rows for built-in collations
like PG16's unicode, so the query also checks pg_attribute and
pg_partitioned_table directly. The new integration test covers that case.

This adds an unreferenced field to the JSON, so the schema goes to 1.6.0.

I tested on PG 18.6 with all 871 ICU collations forced stale. Before: a warn
with 871 evidence lines. After: one info line. The full suite, doc-verify,
lint and gate.sh pass.

Unused ones are now a single info line. Fixes pgrundev#130.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

collation_version_mismatch warns on unused built-in ICU collations (libc-only databases)

1 participant