I've taken over a system using postgres. When logging in, if I use ...
sudo -u postgres psql postgres
...it does NOT ask for a password. However, if I do ...
psql -U postgres -h localhost postgres
... it asks for the password.
Why? How is this difference configured? Can it be configured for a different user to login this way?
postgres is NOT in the
sudoers file, or in the sudo group.