On Thu, Jul 10, 2025 at 5:10 PM Steve Lau <stevelauc@outlook.com> wrote:
> Hi hackers, when reading the source code, I noticed that Postgres is still using getpwuid(), which is not thread-safe
sinceit returns a pointer to the static memory that can be overwritten by concurrent calls. Then I searched "getpwuid"
inthe mailing list[1], and there was a committed patch that refactored one such usage. So maybe we can clean up the
remaininggetpwuid() calls?
+1, we should.
> Then I realized that Postgres does not use threads but processes, so technically IMHO getpwuid() is safe to Postgres?
Butthat patch mentioned that[2]:
We would like to use threads, and many things like this are being
changed currently.