musicbrainz_unaccent
postgresql_musicbrainz_unaccent · Removes accents from Unicode data
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100401 | musicbrainz_unaccent | postgresql_musicbrainz_unaccent | 1.0.0 | FTS | GPL-2.0 | C |
Usage
Sources:
musicbrainz_unaccent removes a fixed set of Unicode accents with a C function and a text-search dictionary. Unlike PostgreSQL’s general-purpose unaccent function, its function is declared immutable so it can be used in expression indexes. It was built for MusicBrainz normalization and its repository is archived.
Core Workflow
Install the extension and use either the scalar function or the text-search dictionary:
The scalar example returns lsctzyai. Queries intended to use the expression index must apply the identical immutable expression.
Important Objects
musicbrainz_unaccent(text)returns normalized text and is declaredIMMUTABLEandSTRICT.musicbrainz_unaccentdict_templateis the text-search dictionary template.musicbrainz_unaccentdictis the installed dictionary; it lowercases lexemes before applying the compiled mapping.
Compatibility and Caveats
The implementation assumes UTF-8 input regardless of the database encoding. Do not use it in a non-UTF-8 database. Its mapping is compiled into the extension binary rather than loaded from an editable dictionary rules file, so changing normalization rules requires a rebuild. Lowercasing also depends on PostgreSQL’s locale behavior. Because the upstream project is archived and tied to old PostgreSQL internals, verify ABI compatibility, locale-sensitive characters, index rebuild behavior, and every language required by the application before adoption. Pin the reviewed source and mapping so normalized keys do not change unexpectedly.