From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-sql@postgresql.org
Subject: Encoding bytea
Date: Wed, 3 Mar 2004 15:12:39 +0200 (EET)
Message-ID: <Pine.LNX.4.44.0403031457110.2444-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0402261124100.3960-100000@matrix.gatewaynet.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: Encoding bytea
In-Reply-To: <Pine.LNX.4.44.0403031457110.2444-100000@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox