Re: bytea and character encoding when inserting escaped literals

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lee Feigenbaum <lee(at)thefigtrees(dot)net>
Cc: Asche <asche(dot)public(at)mac(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: bytea and character encoding when inserting escaped literals
Date: 2008-05-05 19:34:20
Message-ID: 2497.1210016060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lee Feigenbaum <lee(at)thefigtrees(dot)net> writes:
> Would be nice if the bytea parser understood hex representation too, but
> beggars can't be choosers :)

decode() might help you:

select decode('1200AB', 'hex');
decode
--------------
\022\000\253
(1 row)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2008-05-05 19:36:51 Re: operator is not unique: integer || integer
Previous Message Micah Yoder 2008-05-05 19:28:47 psycopg2 and prepared statements