X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C14E5D1BC5C for ; Wed, 3 Mar 2004 13:12:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 15338-04 for ; Wed, 3 Mar 2004 09:12:38 -0400 (AST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id B7659D1B8B7 for ; Wed, 3 Mar 2004 09:12:34 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id i23DCdNu002482 for ; Wed, 3 Mar 2004 15:12:39 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i23DCdav002478 for ; Wed, 3 Mar 2004 15:12:39 +0200 Date: Wed, 3 Mar 2004 15:12:39 +0200 (EET) From: Achilleus Mantzios To: pgsql-sql@postgresql.org Subject: Encoding bytea In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/28 X-Sequence-Number: 17127 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