Find the host name and port using PSQL commands

前端 未结 13 2204
眼角桃花
眼角桃花 2020-12-12 11:15

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

相关标签:
13条回答
  • 2020-12-12 11:45
    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

    0 讨论(0)
提交回复
热议问题