From: | "Frank Millman" <frank(at)chagford(dot)com> |
---|---|
To: | "Daniele Varrazzo" <daniele(dot)varrazzo(at)gmail(dot)com> |
Cc: | <psycopg(at)postgresql(dot)org> |
Subject: | Re: Problem with memoryview |
Date: | 2013-08-01 08:13:03 |
Message-ID: | 2F8F0FA7F9BF4C2DAF92946692183ABF@frank |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
----- Original Message -----
From: "Daniele Varrazzo" <daniele(dot)varrazzo(at)gmail(dot)com>
To: "Frank Millman" <frank(at)chagford(dot)com>
Cc: <psycopg(at)postgresql(dot)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(at)chagford(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Christian.Strobl | 2013-08-01 09:24:11 | [(datetime.datetime(2013, 7, 29, 9, 2, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)),)] |
Previous Message | Frank Millman | 2013-08-01 05:37:19 | Fw: Problem with psycopg2, bytea, and memoryview |