Copying bytea data out via pgsql

From: "John Wells" <jb(at)sourceillustrated(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Copying bytea data out via pgsql
Date: 2005-07-22 13:01:46
Message-ID: 50609.66.192.236.118.1122037306.squirrel@devsea.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Guys,

I have a number of jpegs and tiffs that are stored in a bytea field in a
PostgreSQL database by a Java program using Hibernate.

I need to copy these out to a flat file via pgsql for viewing, etc. I've
tried

psql -c 'select binarydata_field from my_image_table where id=1' mydb >
flatfile

but although that seems to provide the data it does not seem to pull it in
a valid image format. Is there some special handling I need to do here?

Thanks!
John

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roman Neuhauser 2005-07-22 13:15:16 Re: problem casting varchar to inet
Previous Message Michael Fuhr 2005-07-22 12:50:58 Re: problem casting varchar to inet