Re: improve type conversion of SPI_processed in Python

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: improve type conversion of SPI_processed in Python
Дата
Msg-id 7682.1515773182@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: improve type conversion of SPI_processed in Python  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: improve type conversion of SPI_processed in Python
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 1/9/18 15:54, Tom Lane wrote:
>> I'd be inclined to code PLyObject_FromUint64() as an exact
>> analog of PLyLong_FromInt64(), ie
>> 
>> /* on 32 bit platforms "unsigned long" may be too small */
>> if (sizeof(uint64) > sizeof(unsigned long))
>>     return PyLong_FromUnsignedLongLong(DatumGetUInt64(d));
>> else
>>     return PyLong_FromUnsignedLong(DatumGetUInt64(d));
>> 
>> and let Python worry about how to optimize the conversion.

> Would that even be necessary?  Why not use the LongLong variant all the
> time then?

I've not looked at the Python internals to see if one is noticeably faster
than the other, but if it isn't, yeah we could simplify that.  In any case
my main point is let's keep these two functions using similar approaches.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: CREATE ROUTINE MAPPING