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

From: Michael Paquier <[email-masked]>
Date: Thu, 26 Oct 2023 09:40:55 +0900

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

---

From: Tom Lane <[email-masked]>
Date: Wed, 25 Oct 2023 20:49:49 -0400

> makes the code more portable.

Then you're going to need a not-so-portable conversion spec in the
snprintf call.  Not sure it's any improvement.

			regards, tom lane