varchar::bytea fails when varchar contains backslash - Mailing list pgsql-general

From Matthias Apitz
Subject varchar::bytea fails when varchar contains backslash
Date
Msg-id YhNYZ4qVmtjjxdti@c720-r368166
Whole thread Raw
Responses Re: varchar::bytea fails when varchar contains backslash  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-general
Hello,

I wanted to look into a column of type varchar converting the content
with ::bytea to a hex string, but this fails when the column contains a
backslash:

psql -Usisis -dtestdb
psql (14.1)
Geben Sie »help« für Hilfe ein.

testdb=# select trenn from sik_fstab where name='EdvSelKenn';
             trenn
-------------------------------
 ; :,.-!@%&/()=?'*+#<>[\]{|}&"
 ; :,.-!@%&/()=?'*+#<>[\]{|}&"
(2 Zeilen)

testdb=# select trenn::bytea from sik_fstab where name='EdvSelKenn';
ERROR:  invalid input syntax for type bytea

Why is this?

    matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub



pgsql-general by date:

Previous
From: Daevor The Devoted
Date:
Subject: Re: 20220221-Clarification regarding PostgeSQL DB backup
Next
From: Tomas Pospisek
Date:
Subject: Re: Detecting schema changes via WAL logs