Re: replace single char for string using regexp_replace

Tom Lane <[email protected]> Sun, 29 Dec 2019 23:50:03 -0500
Newsgroups gmane.comp.db.postgresql.general
Message-ID <[email protected]>
PegoraroF10 <[email protected]> writes:
> I have to replace ; , " and ' chars in an string putting its correspondent
> ascii value
> I have a
> Replace(Replace(Replace(Replace($$Text,with;On'It"$$,',','chr(59)'),';','chr(44)'),'"','chr(34)'),'''','chr(39)')
> It works but I would like to call just one Replace.

Use translate(), perhaps?

https://www.postgresql.org/docs/current/functions-string.html

			regards, tom lane