I have PSQL running, and am trying to get a perl application connecting to the database. Is there a command to find the current port and host that the database is running on
SELECT CURRENT_USER usr, :'HOST' host, inet_server_port() port;
This uses psql's built in HOST variable, documented here
And postgres System Information Functions, documented here