Programs that access PostgreSQL databases, which are called clients, may be running on the same machine as the server. In this case, the client and server will communicate most efficiently using a Unix-domain socket, a channel of inter-process communication accessed through the filesystem such as a file or directory. Access to a socket is controlled by filesystem permissions.
Other client programs may be able to communicate only over TCP network sockets. These clients may connect to the local server using the loopback interface and IP address of
However, if a client program is located on a machine other than the server, then communication between them must take place over the network using ...