Copying bytea data out via pgsql - Mailing list pgsql-general

From John Wells
Subject Copying bytea data out via pgsql
Date
Msg-id 50609.66.192.236.118.1122037306.squirrel@devsea.com
Whole thread Raw
Responses Re: Copying bytea data out via pgsql
List 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


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: problem casting varchar to inet
Next
From: Roman Neuhauser
Date:
Subject: Re: problem casting varchar to inet