如何在数据库群集中删除所有内容(角色,表格,功能,类型等)而不重新安装PostgreSQL?
我在还原4个数据库的PostgreSQL数据库群集时犯了一个错误。现在,我想通过正确的文件再次恢复备份,但是旧的错误还原中有许多角色,类型和功能。我删除了除Postgres默认数据库外的所有数据库。但是,角色仍然存在,功能和类型也在那里。
我如何在PostgreSQL群集中清除所有内容,并且可以重新开始,而无需卸载并在该计算机上安装PostgreSQL。
我在互联网上阅读,我应该删除PostgreSQL的所有内容 /数据目录中的所有内容!恐怕它可能会损坏某些东西。
有什么更好的方法吗?
当我在psql工具中执行\ l时,我会有以下结果:
I have made a mistake while restoring a PostgreSQL database cluster of 4 databases. Now, I want to restore my backup again with the correct file, but there are many roles, types and functions from the old erroneous restore. I deleted every database except postgres default DB. However, roles are still there and functions and types are also there.
How can I clear everything in a PostgreSQL cluster and have a fresh start without having to uninstall and install PostgreSQL on this machine.
I read on the internet that I should delete everything in /data directory of PostgreSQL!! I am afraid it may damage something.
Any better way to do it?
When I do \l in psql tool I have the following result:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论