↑↓ 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 all occurrences in string of substring from with substring to.

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

Signatures & examples

replace ( string text, from text, to text ) → text
Replaces all occurrences in string of substring from with substring to.
replace('abcdefabcdef', 'cd', 'XX') → abXXefabXXef
Version history 2
  1. 12 → 13 changed
  2. 7.2 → 7.3 added

Definition snapshot: b7bd9cda · English manual source