开发者

postgresql: how to delete database cluster

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜