Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 postgresql 有问题,我复制了所有文件,然后将其删除。然后,我安装了新的,问题就解决了。现在可以将旧文件和文件导入新文件吗?
如果它们是相同的主要版本(即 9.0 到 9.0.4,而不是 9.0 到 9.1),那么您可以在旧数据目录中启动并获取所有内容。PostgreSQL 没有用于表文件的简单导入工具,因此如果您只想拉入一些表,最好的选择是pg_dump -c紧随其后,pg_restore -t tablename这样您就可以有选择地将表恢复到新集群中。
pg_dump -c
pg_restore -t tablename