Re: "long" type is not appropriate for counting tuples

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: "long" type is not appropriate for counting tuples
Дата
Msg-id 5bd0e87a-3467-1851-8c60-bfe7a681ab7d@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: "long" type is not appropriate for counting tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: "long" type is not appropriate for counting tuples  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 2019-05-22 21:21, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> Could we define int64 to be long long int on all platforms and just
>> always use %lld?
> 
> Hmmm ... maybe.  Once upon a time we had to cope with compilers
> that didn't have "long long", but perhaps that time is past.

It's required by C99, and the configure test for C99 checks it.

> Another conceivable hazard is somebody deciding that the world
> needs a platform where "long long" is 128 bits.  I don't know
> how likely that is to happen.

Another option is that in cases where it doesn't affect storage layouts,
like the counting tuples case that started this thread, code could just
use long long int directly instead of int64.  Then if someone wants to
make it 128 bits or 96 bits or whatever it would not be a problem.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Julian Schauder
Дата:
Сообщение: Re: Excessive memory usage in multi-statement queries w/partitioning
Следующее
От: David Rowley
Дата:
Сообщение: Re: Excessive memory usage in multi-statement queries w/ partitioning