Earlier quoted context omitted.
To be super clear, because it can be less than perfectly obvious, this means on `localhost` but also on loopback. There is no 'real' network device talking to this port.
it also isn't "open"; your username has to match the postgres database username to connect. 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