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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Should we represent temp files as unsigned long int instead of signed long int type?
Дата
Msg-id ZTm1l12SJzUwQbpb@paquier.xyz
обсуждение исходный текст
Ответ на Re: Should we represent temp files as unsigned long int instead of signed long int type?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Should we represent temp files as unsigned long int instead of signed long int type?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Oct 25, 2023 at 03:07:39PM -0400, Tom Lane wrote:
> 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.

In the mood of removing long because it may be 4 bytes or 8 bytes
depending on the environment, I'd suggest to change it to either int64
or uint64.  Not that it matters much for this specific case, but that
makes the code more portable.
--
Michael

Вложения

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Document aggregate functions better w.r.t. ORDER BY
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Should we represent temp files as unsigned long int instead of signed long int type?