Re: bytea extraction - Mailing list psycopg

From Adrian Klaver
Subject Re: bytea extraction
Date
Msg-id 52EFD7E5.5070301@gmail.com
Whole thread Raw
In response to bytea extraction  (Rich Harley <richard@scholarpack.com>)
Responses Re: bytea extraction  (Rich Harley <richard@scholarpack.com>)
List psycopg
On 02/03/2014 09:50 AM, Rich Harley wrote:
> How do I grab a bytea object stored in a postgres database and write it to the filesystem?
>
> Say I have a .jpeg stored in a table called pictures. I want to extra that object (select picture from pictures),
thenwrite it to a file called picture.jpg through the use of a python script. 
> I have tried several ways but the end file is always messed up and not the original picture.
> Any pointers?

Well the default format for bytea has changed with Postgres versions and
how Psycopg handles same has changed over time. So to begin to answer
this we will need to know what versions of Postgres and psycopg2 you are
using?

>
> Thanks
> Rich
>



--
Adrian Klaver
adrian.klaver@gmail.com


psycopg by date:

Previous
From: Rich Harley
Date:
Subject: bytea extraction
Next
From: Rich Harley
Date:
Subject: Re: bytea extraction