How to print what your database server IP address and port number are:
SELECT inet_server_address(); SELECT inet_server_port();
There isn't any way to put that into the psql prompt, though.
Best,-at