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 72897D1DACD for ; Mon, 8 Mar 2004 07:24:02 +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 07799-04 for ; Mon, 8 Mar 2004 03:24:01 -0400 (AST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 922A1D1CA50 for ; Mon, 8 Mar 2004 03:23:59 -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 i287ONNu029189; Mon, 8 Mar 2004 09:24:23 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i287ONIO029185; Mon, 8 Mar 2004 09:24:23 +0200 Date: Mon, 8 Mar 2004 09:24:23 +0200 (EET) From: Achilleus Mantzios To: beyaNet Consultancy Cc: pgsql-sql@postgresql.org Subject: Re: Read bytea column from table and convert into base64..... In-Reply-To: <30AF055A-6F01-11D8-B866-0003938366A4@ntlworld.com> 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/51 X-Sequence-Number: 17150 O kyrios beyaNet Consultancy egrapse stis Mar 5, 2004 : > Hi, > I have a bytea column which I want to convert into base64. At the > moment I am reading the bytea colum into my java app as a byte[]. I am > then calling another static method to convert the byte[] into base64. I > want postgreSQl to handle the conversion so my app can read in the > base64 string. > > So for example: > > select (base64)byteaColumn from tableName where artistID = x You can use encode function as : select encode(byteaColumn,'base64') from tableName where artistID = x > > many thanks in advance > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- -Achilleus