I've checked postgres repository and default has been to listen on localhost for at least 15 years.
https://github.com/postgres/postgres/blob/master/src/backend...
https://github.com/postgres/postgres/blob/master/src/backend...
IE; the 'postgres' unix user is required to access databases as the 'postgres' database user.
This is the case for the official docker image at least, and I'm fairly certain also true of distro package managers