I think there is a typo in Marius' comment. Pretty sure the first line should say 'unix socket' and not 'UDP socket'. They are different things and I don't think it is possible to connect to postgres via UDP.
postgresql:/// connects over a UDP socket and can use the Unix userid to authenticate.
postgresql://host:port/ connects over TCP, where the userid of the remote end is not known (or cannot be trusted).
It's a bit of a simplification to say pg_hba.conf doesn't matter: you need to allow Unix domain socket connections in that config file if you want paswordless logins. It's just that the default settings already allow that.
Comment
I think there is a typo in Marius' comment. Pretty sure the first line should say 'unix socket' and not 'UDP socket'. They are different things and I don't think it is possible to connect to postgres via UDP.
Parent comment
postgresql:/// connects over a UDP socket and can use the Unix userid to authenticate. postgresql://host:port/ connects over TCP, where the userid of the remote end is not known (or cannot be trusted). It's a bit of a simplification to say pg_hba.conf doesn't matter: you need to allow Unix domain socket connections in that config file if you want paswordless logins. It's just that the default settings already allow that.
Replies
*headslap*
Thanks for correcting me. I don't know how I managed to type "UDP" when I meant "Unix domain".