Strip diacritical marks from the input string, producing plain ASCII where possible.
REMOVE_ACCENTS(str)
## Overview Removes combining diacritical marks (accents, umlauts, tildes, cedillas, and other Unicode combining marks) from the input string. The output keeps the base letters intact so that canonical characters remain readable. Use this function to normalize text for search, deduplication, slug generation, or comparison against ASCII-only reference data. ## Behavior - Returns NULL if the input is NULL. - Decomposes input using Unicode NFD then removes combining marks in the Mn category. - Base letters are preserved (for example, e with acute becomes e; o with diaeresis becomes o). - Characters with no ASCII equivalent (for example, the German sharp s) are returned unchanged; this function is not a full transliteration. - Deterministic and side effect free. ## Compatibility - Matches the PG-compat REMOVE_ACCENTS semantics commonly provided by the `unaccent` module.
| Name | Type | Description |
|---|---|---|
str | Specifies the input string. Combining diacritical marks are removed; base letters are preserved. |
-- Remove accents from French text
SELECT REMOVE_ACCENTS('cafe\u0301 cre\u0300me bru\u0302le\u0301e'); -- 'cafe creme brulee'
-- Remove umlauts from German text
SELECT REMOVE_ACCENTS('Mu\u0308nchen');
-- Normalize names for case-insensitive search
SELECT customer_id FROM crm.catalog.customers
WHERE LOWER(REMOVE_ACCENTS(name)) = LOWER(REMOVE_ACCENTS('Jose\u0301'));
-- NULL propagation
SELECT REMOVE_ACCENTS(NULL); -- NULL