如何查看PostgreSQL的监听端口呢?下面总结一下查看PostgreSQL监听端口的方法。
方法1:netstat命令查看
或者sudo netstat -plunt |grep postmaster
方法2:查询/etc/services
注意:如果用户没有配置services的话,这个方法就无效。
方法3:SQL查询pg_settings表
4:从postgresql.conf中确认
当然,你得定位或找到postgresql.conf的位置。然后执行下面脚本。
$grep port postgresql.conf
5:使用命令conninfo查看
postgres=# \conninfo
You are connected to database “postgres” as user “postgres” via socket in “/tmp” at port “5432”.
Original: https://www.cnblogs.com/kerrycode/p/16138186.html
Author: 潇湘隐者
Title: 查看PostgreSQL监听端口
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/601542/
转载文章受原作者版权保护。转载请注明原作者出处!