Encoding bytea

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Encoding bytea
Date: 2004-03-03 13:12:39
Message-ID: Pine.LNX.4.44.0403031457110.2444-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2004-03-03 22:59:14 Re: Encoding bytea
Previous Message Richard Huxton 2004-03-03 12:51:12 Re: oracle decode()