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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "long" type is not appropriate for counting tuples
Дата
Msg-id 2089.1558540366@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "long" type is not appropriate for counting tuples  (Andres Freund <andres@anarazel.de>)
Ответы Re: "long" type is not appropriate for counting tuples  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On May 22, 2019 7:39:41 AM PDT, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
>> On 2019-04-29 19:32, Tom Lane wrote:
>>> Another problem is that while "%lu" format specifiers are portable,
>>> INT64_FORMAT is a *big* pain, not least because you can't put it into
>>> translatable strings without causing problems.  To the extent that
>>> we could go over to "%zu" instead, maybe this could be finessed,
>>> but blind "s/long/int64/g" isn't going to be any fun.

>> Since we control our own snprintf now, this could probably be addressed
>> somehow, right?

> z is for size_t though? Not immediately first how It'd help us?

Yeah, z doesn't reliably translate to int64 either, so it's only useful
when the number you're trying to print is a memory object size.

I don't really see how controlling snprintf is enough to get somewhere
on this.  Sure we could invent some new always-64-bit length modifier
and teach snprintf.c about it, but none of the other tools we use
would know about it.  I don't want to give up compiler cross-checking
of printf formats, do you?

            regards, tom lane



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

Предыдущее
От: Stas Kelvich
Дата:
Сообщение: Re: Read-only access to temp tables for 2PC transactions
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: VACUUM fails to parse 0 and 1 as boolean value