Re: Problem with memoryview - Mailing list psycopg

From Frank Millman
Subject Re: Problem with memoryview
Date
Msg-id 2F8F0FA7F9BF4C2DAF92946692183ABF@frank
Whole thread Raw
In response to Problem with memoryview  ("Frank Millman" <frank@chagford.com>)
List 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 by date:

Previous
From: "Frank Millman"
Date:
Subject: Fw: Problem with psycopg2, bytea, and memoryview
Next
From:
Date:
Subject: [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)]