Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot kill Postgres process

Tags:

I keep trying to kill a PostgreSQL process that is running on port 5432 to no avail. Whenever I type sudo lsof -i :5432, I see something like the below:

COMMAND  PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME postgres 587 postgres    4u  IPv6 0x218f97e9af5d0303      0t0  TCP *:postgresql (LISTEN) postgres 587 postgres    5u  IPv4 0x218f97e9ae0f6c63      0t0  TCP *:postgresql (LISTEN) 

I then try to kill the process 587 in this example with sudo kill -9 587, but then another process automatically restarts on the same port! I have tried killing it on activity monitor as well to no avail. Please help?

Thanks, Laura

like image 681
flaurida Avatar asked Jun 17 '17 17:06

flaurida


People also ask

How do you kill a process in pgAdmin?

Go to Dashboard in your pgAdmin. At the bottom, in the Server Activity section, under the Sessions Tab, you can see all the Active queries. Now, notice the cross button and the Stop button to the left of each query.


1 Answers

If you installed postgres using brew, this command might be what you are looking for :

brew services stop postgres 
like image 68
Moebius Avatar answered Oct 03 '22 13:10

Moebius