Re: Change in datetime type casting

From: Federico Di Gregorio <fog(at)dndg(dot)it>
To: psycopg(at)postgresql(dot)org
Subject: Re: Change in datetime type casting
Date: 2012-06-28 15:13:15
Message-ID: 4FEC748B.1020604@dndg.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On 28/06/12 16:43, Daniele Varrazzo wrote:
>
>> > Bigger question:) Is it possible to turn adaption off for a
>> > connection/cursor?
> No, I think adaptation is currently only global. No, I don't like this
> asymmetry with typecasting either.

This asymmetry exists because adaptation was modeled on PEP 246 and at
the time a global type registry was enough (you could always write your
own wrapper that would adapt the wrapped object, see AsIs for an example.)

Having per-connection and per-cursor adapter registries would be nice.

federico

--
Federico Di Gregorio federico(dot)digregorio(at)dndg(dot)it
Studio Associato Di Nunzio e Di Gregorio http://dndg.it
Qu'est ce que la folie? Juste un sentiment de liberté si
fort qu'on en oublie ce qui nous rattache au monde... -- J. de Loctra

In response to

Browse psycopg by date

  From Date Subject
Next Message Никитин Константин 2012-06-29 06:03:27 A very strange freeze
Previous Message Adrian Klaver 2012-06-28 14:52:41 Re: Change in datetime type casting