pgstrtranslate
pgstrtranslate · Adds multi-character string replacement and text-array element removal functions.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100690 | pgstrtranslate | pgstrtranslate | 1.0 | FUNC | Unknown | C |
Usage
Sources:
pgstrtranslate extends PostgreSQL’s character-wise translate operation with ordered multi-character replacements. Its function pgstrtranslate(boolean, text, text[], text[]) returns text.
With the first argument false, all search terms are matched against the original input, so replacements do not create new matches. With it true, replacements run sequentially and later search terms can match text produced by earlier replacements. Order therefore changes results.
Require search and replacement arrays to have the intended pairing and test empty elements, duplicates, overlaps, nulls, multibyte text, and expansion. The function is marked immutable, so any persisted index or generated value assumes stable byte-for-byte semantics. Version 1.0 has no current compatibility matrix; benchmark worst-case overlapping patterns and validate output before using it for canonicalization, security filtering, or identifiers.