Re: Displaying text appears as hex data - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: Displaying text appears as hex data
Date
Msg-id 20110208110740.GL2869@hermes.hilbert.loc
Whole thread Raw
In response to Displaying text appears as hex data  (Michael <postgresql@encambio.com>)
Responses Re: Displaying text appears as hex data  (Michael <postgresql@encambio.com>)
List pgsql-general
On Tue, Feb 08, 2011 at 11:39:04AM +0100, Michael wrote:

> I'm trying to view text data stored by OpenSIPS 1.6.4 (the latest)
> as BLOB

I take it you mean BYTEA.

> and PostgreSQL is displaying it in hex format like so:
>
> $ TERM=vt100 /pfx/bin/psql opensips opensips
> psql (9.0.2)
> Type "help" for help.
>
> opensips=> select * from sip_trace;
>  id | time_stamp | callid | traced_user | msg | method | ...
>  1234 | 2011-02-03 | ... | | \x494e56495445207369703a...
>
> Others have said that when they use MySQL, the exact SQL command
> as above results in ASCII text rather than hexadecimal, and this
> is my goal as well.

You might attempt to apply decode(column, 'hex') to the
relevant column.

Better be sure the result really is printable text.

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Displaying text appears as hex data
Next
From: Fujii Masao
Date:
Subject: Re: Maintenance commands on standby servers