replace single char for string using regexp_replace

Поиск
Список
Период
Сортировка
От PegoraroF10
Тема replace single char for string using regexp_replace
Дата
Msg-id 1577664059509-0.post@n3.nabble.com
обсуждение исходный текст
Ответы Re: replace single char for string using regexp_replace  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: replace single char for string using regexp_replace  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
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.

I tried this but didn´t work
select
regexp_replace($$Text,with;On'It"$$,$$,|;|"|'$$,$$chr(59)|chr(44)|chr(34)|chr(39)$$,'g');
, -> chr(59)
; -> chr(44)
" -> chr(34)
' -> chr (39)




--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html



В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Are my autovacuum settings too aggressive for this table?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: replace single char for string using regexp_replace