Re: Should we represent temp files as unsigned long int instead of signed long int type?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Should we represent temp files as unsigned long int instead of signed long int type?
Дата
Msg-id 1013454.1698260859@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Should we represent temp files as unsigned long int instead of signed long int type?  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Ответы Re: Should we represent temp files as unsigned long int instead of signed long int type?  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Ashutosh Sharma <ashu.coek88@gmail.com> writes:
> At present, we represent temp files as a signed long int number. And
> depending on the system architecture (32 bit or 64 bit), the range of
> signed long int varies, for example on a 32-bit system it will range
> from -2,147,483,648 to 2,147,483,647. AFAIU, this will not allow a
> session to create more than 2 billion temporary files and that is not
> a small number at all, but still what if we make it an unsigned long
> int which will allow a session to create 4 billion temporary files if
> needed.

AFAIK, nothing particularly awful will happen if that counter wraps
around.  Perhaps if you gamed the system really hard, you could cause
a collision with a still-extant temp file from the previous cycle,
but I seriously doubt that could happen by accident.  So I don't
think there's anything to worry about here.  Maybe we could make
that filename pattern %lu not %ld, but minus sign is a perfectly
acceptable filename character, so such a change would be cosmetic.

            regards, tom lane



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Custom tstzrange with importance factored in
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Should we represent temp files as unsigned long int instead of signed long int type?