Re: bytea extraction

Поиск
Список
Период
Сортировка
От Rich Harley
Тема Re: bytea extraction
Дата
Msg-id CFF4343A-8298-44D9-8CFA-0E5F7DDA477D@scholarpack.com
обсуждение исходный текст
Ответ на Re: bytea extraction  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: bytea extraction  (Adrian Klaver <adrian.klaver@gmail.com>)
Список psycopg
Ah, I see. It’s postgres 9.1 and psycopg1 (through Zope 2.11) - an old one but we have found no need to upgrade as yet
becausewe only use very simple data types. 

When the data goes in it goes through psycopg.Binary(photo).
So it’s really the reverse of that I need.


On 3 Feb 2014, at 17:54, Adrian Klaver <adrian.klaver@gmail.com> wrote:

> 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: bytea extraction
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: bytea extraction