Home > database >  Local PostgreSQL instance returns empty on select inet_server_addr(),inet_client_addr();
Local PostgreSQL instance returns empty on select inet_server_addr(),inet_client_addr();

Time:03-01

I was testing to see whether localhost would be returned (I have two separate PostgreSQL instances running locally) but the return values when typing select inet_server_addr(),inet_client_addr(); are empty.

postgres=# select inet_server_addr(),inet_client_addr();
 inet_server_addr | inet_client_addr 
------------------ ------------------
                  | 
(1 row)

What does empty here signify?

CodePudding user response:

What does empty here signify?

It means you are not connecting via the network but locally via unix-domain sockets. According to the documentation the returned values are NULL in this case:

Returns the IP address on which the server accepted the current connection, or NULL if the current connection is via a Unix-domain socket.

  • Related