↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / String Functions And Operators

Replaces each character in string that matches a character in the from set with the corresponding character in the to set.

Reading PG 18current·documented in 27 of 27 versions, 7.1 to 20

Signatures & examples

translate ( string text, from text, to text ) → text
Replaces each character in string that matches a character in the from set with the corresponding character in the to set. If from is longer than to, occurrences of the extra characters in from are deleted.
translate('12345', '143', 'ax') → a2x5
Version history 2
  1. 12 → 13 changed
  2. 9.0 → 9.1 changed

Definition snapshot: b7bd9cda · English manual source