Re: Displaying text appears as hex data

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Displaying text appears as hex data
Date: 2011-02-08 11:07:40
Message-ID: 20110208110740.GL2869@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2011-02-08 12:05:55 Re: Maintenance commands on standby servers
Previous Message Thom Brown 2011-02-08 11:03:00 Re: Displaying text appears as hex data