Re: [PATCH] Fix conversion for Decimal arguments in plpython functions

Поиск
Список
Период
Сортировка
От Szymon Guz
Тема Re: [PATCH] Fix conversion for Decimal arguments in plpython functions
Дата
Msg-id CAFjNrYuZW_1zPs1SJtJJAPSdnGZ=r4S7Ks4rE1yVa0-JVrHQMA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Fix conversion for Decimal arguments in plpython functions  (Ronan Dunklau <rdunklau@gmail.com>)
Ответы Re: [PATCH] Fix conversion for Decimal arguments in plpython functions  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 26 June 2013 12:04, Ronan Dunklau <rdunklau@gmail.com> wrote:
It seems like you confused me with steve :)


Hi Ronan,
Oh, yes. I'm sorry for that :) 
 
The patch applies cleanly, and the regression tests pass on python2 when cdecimal is not installed. When it is, the type info returned for the converted numeric value is cdecimal.Decimal instead of decimal.Decimal.

The regression tests expected output have not been modified for python3, and as such they fail on the type conversions.

I am a bit confused with the use of PyModule_GetDict: shouldn't PyObj_GetAttrString be used directly instead ? Moreover, the reference count in the current implementation might be off: the reference count for the decimal module is never decreased, while the reference count to the module dict is, when the docs say it returns a borrowed reference.

Please find a patch that fixes both issues.


Thanks for the patch. I assume you generated that from clean trunk, and it includes all the changes (mine and yours) right?

I've checked the patch, everything looks great.
I've attached it to this email with changed name, just for consistent naming in commitfest app.

thanks,
Szymon

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Review: Patch to compute Max LSN of Data Pages
Следующее
От: Ants Aasma
Дата:
Сообщение: Re: Bloom Filter lookup for hash joins