Re: Change in datetime type casting

Поиск
Список
Период
Сортировка
От Federico Di Gregorio
Тема Re: Change in datetime type casting
Дата
Msg-id 4FEC247F.1030601@dndg.it
обсуждение исходный текст
Ответ на Re: Change in datetime type casting  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список psycopg
On 28/06/12 11:21, Daniele Varrazzo wrote:
> On Thu, Jun 28, 2012 at 7:30 AM, Federico Di Gregorio <fog@dndg.it> wrote:
>> > On 28/06/12 01:19, Adrian Klaver wrote:
>>> >> Note the addition of the casts. This is causing problems when using the
>>> >> hstore adapter as hstore expects a plain string. Is there a way to get
>>> >> around this?
>> >
>> > The cast were introduced because PostgreSQL 9.x is much strictier about
>> > function signatures than the 8.x series. Sometimes functions taking
>> > parameters were not found because of the implicit text->other type cast.
> Hstore is a mapping from strings to strings, not a generic dictionary
> mapping. There's never been a promise to adapt generic python
> dictionary (mapping hashable -> anything) into it. Even if you ram a
> python date into a postgres hstore, reading it back you will get a
> string.

Doh! I wasn't aware that hstore used text only (never needed it myself).

federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
Studio Associato Di Nunzio e Di Gregorio                  http://dndg.it
 Everything will be OK at the end. If it's not OK, it's not the end.
                                                              -- Unknown

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

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Change in datetime type casting
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Change in datetime type casting