Outils pour utilisateurs

Outils du site


tech:postgres_-_se_connecter_a_une_socket

Postgres - se connecter a une socket

ps -ef |grep postgres

Trouver le PID du process Postgres père
Exemple : 2962

# ls -l /proc/2962/fd/ |grep socket
lrwx------. 1 postgres postgres 64 Aug  8 06:55 3 -> socket:[25104]
lrwx------. 1 postgres postgres 64 Aug  8 06:55 4 -> socket:[25106]
lrwx------. 1 postgres postgres 64 Aug  8 06:55 8 -> socket:[25118]
# #lsof -i -a -p 2962
# #find / -user postgres -type s 2>/dev/null
# #netstat -lx |egrep "25104|25106|25118"
# ss -xl |egrep "25104|25106|25118"
u_str LISTEN 0      2048                                            /tmp/.s.PGSQL.5455 25106               * 0
su - postgres
$ psql -h /tmp/.s.PGSQL.5455
psql: error: could not connect to server: Not a directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5455/.s.PGSQL.5432"?

$ psql -h /tmp
psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Solution

psql -h /tmp -p 5455

FIXME

tech/postgres_-_se_connecter_a_une_socket.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki