开发者

postgresql: how to delete database cluster

开发者 https://www.devze.com 2023-03-26 16:49 出处:网络
I have used the command initdb to create a da开发者_Go百科tabase cluster: sudo su postgres -c \'/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb\'

I have used the command initdb to create a da开发者_Go百科tabase cluster:

sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb'

If I want to delete this database cluster, can I simply remove the folder defaultdb? Or is there some command I should use?


If you are using something debian-like, the cleanest way is to run pg_dropcluster

pg_dropcluster --stop 9.4 main 


Yes, If you want to delete the database cluster you just created just remove the data directory /opt/local/var/db/postgresql83/defaultdb.

By the way, if the PG server is running, shut it down before.

0

精彩评论

暂无评论...
验证码 换一张
取 消