On Sat, Mar 17, 2018 at 09:40:51PM +0100, Christoph Berg wrote:
> $ chmod 700 .
> $ sudo -u postgres psql
> could not change directory to "/home/cbe": Permission denied
>
> I never observed any negative side effects of it, though. (Except for
> the obvious fact that "\i somethinginmyhome.sql" won't work.)
At least on NetBSD, shutting down the system with sudo while being in a
0700 directory will make the pgsql rc-script fail (because it relies on
pg_ctl), i.e. pull the plug on a running pgsql instance.
One could argue that the NetBSD /etc/rc script should, in general, chdir
before doing anything but relying on getcwd/chdir still seems suboptimal.