Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iliUg-00079v-BQ for pgsql-general@arkaria.postgresql.org; Mon, 30 Dec 2019 00:01:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iliUc-00027W-Gg for pgsql-general@arkaria.postgresql.org; Mon, 30 Dec 2019 00:01:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iliUc-00027P-7A for pgsql-general@lists.postgresql.org; Mon, 30 Dec 2019 00:01:06 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iliUX-0002BL-NX for pgsql-general@postgresql.org; Mon, 30 Dec 2019 00:01:05 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 9C5D019CA9AF0 for ; Sun, 29 Dec 2019 17:00:59 -0700 (MST) Date: Sun, 29 Dec 2019 17:00:59 -0700 (MST) From: PegoraroF10 To: pgsql-general@postgresql.org Message-ID: <1577664059509-0.post@n3.nabble.com> Subject: replace single char for string using regexp_replace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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)'),';','ch= r(44)'),'"','chr(34)'),'''','chr(39)') It works but I would like to call just one Replace. I tried this but didn=C2=B4t work select regexp_replace($$Text,with;On'It"$$,$$,|;|"|'$$,$$chr(59)|chr(44)|chr(34)|c= hr(39)$$,'g'); , -> chr(59) ; -> chr(44) " -> chr(34) ' -> chr (39) -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.h= tml