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.
精彩评论