Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Moench-Tegeder <cmt@burggraben.net>
Cc: Anders Kaseorg <andersk@mit.edu>, Daniel Gustafsson <daniel@yesql.se>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>, alvherre@alvh.no-ip.org,
pgsql-hackers@lists.postgresql.org
Date: 2022-01-09T23:16:43Z
Lists: pgsql-hackers
Christoph Moench-Tegeder <cmt@burggraben.net> writes: > ## Tom Lane (tgl@sss.pgh.pa.us): >> Isn't that a flat out violation of POSIX 8.3 Other Environment Variables? > After poking around across some Linuxes, it looks like people silently > agreed that "services" are not logged-in users: among the daemons, > having HOME set (as observed in /proc/*/environ) is an exception, > not the norm. Meh. I guess there's not much point in arguing with facts on the ground. Anders' proposed behavior seems like the way to go then, at least so far as libpq is concerned. (I remain skeptical that psql would be run in such an environment, but there's no value in making it act different from libpq.) regards, tom lane
Commits
-
Clean up messy API for src/port/thread.c.
- 98e93a1fc93e 15.0 landed
-
Prefer $HOME when looking up the current user's home directory.
- 376ce3e404b7 15.0 landed