pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Read bytea column from table and convert into base64.....
2+ messages / 2 participants
[nested] [flat]

* Read bytea column from table and convert into base64.....
@ 2004-03-05 23:59 beyaNet Consultancy <beyanet@ntlworld.com>
  2004-03-08 07:24 ` Re: Read bytea column from table and convert into base64..... Achilleus Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 1 reply; 2+ messages in thread

From: beyaNet Consultancy @ 2004-03-05 23:59 UTC (permalink / raw)
  To: pgsql-sql

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

many thanks in advance




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Read bytea column from table and convert into base64.....
  2004-03-05 23:59 Read bytea column from table and convert into base64..... beyaNet Consultancy <beyanet@ntlworld.com>
@ 2004-03-08 07:24 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Achilleus Mantzios @ 2004-03-08 07:24 UTC (permalink / raw)
  To: beyaNet Consultancy <beyanet@ntlworld.com>; +Cc: 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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-03-08 07:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-05 23:59 Read bytea column from table and convert into base64..... beyaNet Consultancy <beyanet@ntlworld.com>
2004-03-08 07:24 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>

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