Encoding bytea - Mailing list pgsql-sql

From Achilleus Mantzios
Subject Encoding bytea
Date
Msg-id Pine.LNX.4.44.0403031457110.2444-100000@matrix.gatewaynet.com
Whole thread Raw
In response to Re: updating remote database  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Responses Re: Encoding bytea
List pgsql-sql
Hi,
is there a way to encode a bytea in such a way that the resulting
text stream be readily available (\\ escaped for unprintable chars) for 
usage in an insert statement?

None of base64,hex,escape options in encode() seem to produce
anything close.

This is meant to be used with generating insert statements in xml files
for remote processing.

I can always (in java) ResultSet.getString(bytea_col_idx), 
get the result (ala psql) with one "\" trimmed out,
and process the output (by adding an extra "\" where needed) from there, 
but i am not sure if the jdbc driver will be allowing this ... convinience
in the future.

Thanx.

-- 
-Achilleus



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: oracle decode()
Next
From: Joe Conway
Date:
Subject: Re: Encoding bytea