STR_REPLACE Function - Sybase ASE to PostgreSQL Migration

In Sybase Adaptive Server Enterprise (Sybase ASE) you can use STR_REPLACE function to replace all occurrences of a substring in string. In PostgreSQL you can use REPLACE function.

Sybase ASE:

  -- Replace 'bc' with '12'
  SELECT STR_REPLACE('abcd', 'bc', '12');
  # a12d

PostgreSQL:

  -- Replace 'bc' with '12'
  SELECT REPLACE('abcd', 'bc', '12');
  # a12d

For more information, see Sybase ASE to PostgreSQL Migration.