postgresqlpsql

Find the host name and port using PSQL commands


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?


Solution

  • The default PostgreSQL port is 5432. The host that the database is operating on should have been provided by your hosting provider; I'd guess it would be the same host as the web server if one wasn't specified. Typically this would be configured as localhost, assuming your web server and database server are on the same host.