how to stop postgres db in linux
文章來源: Unix19982019-05-04 09:07:20

1 : find          postgres                     datafile       location : 

 

red  font   is postgre database file 

-bash-4.2$ ps -ef | grep post 


postgres  5355     1  0 09:26 ?        00:00:00 /usr/pgsql-9.5/bin/postgres -D /var/lib/pgsql/9.5/data
postgres  5465  5355  0 09:27 ?        00:00:00 postgres: logger process
 

2 :   run the follwing command , red font part was copied from 1 st step 

 pg_ctl -D /var/lib/pgsql/9.5/data stop

 

waiting for server to shut down.... done
server stopped