Amn Ojee Uw <amnojeeuw@gmail.com> writes:
> After this command 'sudo -u postgres psql'
> I get this message :
> *could not change directory to "/home/my_account": Permission denied**
> **psql (12.15 (Debian 12.15-1.pgdg120+1))**
> **Type "help" for help.*
This is normal if you launch psql via "sudo -u postgres" in a directory
that the postgres user doesn't have permissions to read/chdir to.
psql will still start, but its working directory will not be what
you'd expect, so commands that involve local filesystem access might
misbehave.
We have a fix for this error report in the upcoming v16, but psql commands
that involve local filesystem access will still not act very nicely if
psql can't read your directory.
regards, tom lane