Find the host name and port using PSQL commands

前端 未结 13 2229
眼角桃花
眼角桃花 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:43

    The postgresql port is defined in your postgresql.conf file.

    For me in Ubuntu 14.04 it is: /etc/postgresql/9.3/main/postgresql.conf

    Inside there is a line:

    port = 5432
    

    Changing the number there requires restart of postgresql for it to take effect.

提交回复
热议问题