Re: Read bytea column from table and convert into base64.....

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: beyaNet Consultancy <beyanet(at)ntlworld(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Read bytea column from table and convert into base64.....
Date: 2004-03-08 07:24:23
Message-ID: Pine.LNX.4.44.0403080923390.29173-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Silke Trissl 2004-03-08 08:00:26 Re: designer tool connect to PostgreSQL
Previous Message Yasir Malik 2004-03-08 03:54:31 Re: designer tool connect to PostgreSQL