Re: Problem with memoryview

Поиск
Список
Период
Сортировка
От Frank Millman
Тема Re: Problem with memoryview
Дата
Msg-id 2F8F0FA7F9BF4C2DAF92946692183ABF@frank
обсуждение исходный текст
Ответ на Problem with memoryview  ("Frank Millman" <frank@chagford.com>)
Список psycopg
----- Original Message -----
From: "Daniele Varrazzo" <daniele.varrazzo@gmail.com>
To: "Frank Millman" <frank@chagford.com>
Cc: <psycopg@postgresql.org>
Sent: Wednesday, July 31, 2013 4:56 PM
Subject: Re: [psycopg] Problem with memoryview


> On Wed, Jul 31, 2013 at 3:08 PM, Frank Millman <frank@chagford.com> wrote:
>>
>> The following refers to Python 3.3.
>>
>> I know that if you create a column of type 'bytea', psycopg2 accepts a
>> variety of inputs, but always returns a 'memoryview'.
>>
>> I would like to know if it is possible, through some customisation
>> option,
>> to tell it to return 'bytes'.
>
> Yes: you can easily create a typecaster converting bytea data to bytes:
>
[..]

Thanks very much, Daniele. I have tested it, and it works like a charm :-)

Frank



В списке psycopg по дате отправления:

Предыдущее
От: "Frank Millman"
Дата:
Сообщение: Fw: Problem with psycopg2, bytea, and memoryview
Следующее
От:
Дата:
Сообщение: [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]