Re: Confusion over Python drivers

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: Confusion over Python drivers
Дата
Msg-id 1ab8bf7aa82cc6940c833e922a152cd1@biglumber.com
обсуждение исходный текст
Ответ на Re: Confusion over Python drivers  (Andrew McNamara <andrewm@object-craft.com.au>)
Ответы Re: Confusion over Python drivers
Список pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


>>The solution is to write the query in an unambiguous way:
>>
>>  SELECT $1::date + 1;
>>
>>which is good practice, anyway. If it's not obvious to the type
>>inference system, it's probably not obvious to you, and will probably
>>surprise you ;)
>
> That address this specific case, but it's ugly and not general. The right
> thing is to set the correct type when you're marshalling the parameters...

Well, ugly is in the eye of the beholder, and it certainly is a general 
solution. Any query with ambiguity in its parameters should explicitly 
declare the types, inside the query itself. Having the driver indicate 
the type should be the exception, not the rule.

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201002091811
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: a common place for pl/perlu modules
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: TCP keepalive support for libpq