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.
有没有办法只使用 psql 转储 postgres 数据库(没有 pg_dump )?谢谢。
从理论上讲,您可以访问所需的所有数据。在实践中,您更有可能使用COPY命令转储/保存一些数据,但不能使用数据库模式等。
COPY
请注意,如果数据库服务器侦听网络,则不必pg_dump在数据库服务器所在的同一台计算机上。但是好吧,我不知道你为什么要问:)
pg_dump
理论上,您可以运行查询来提取模式,然后使用这些结果来提取数据。但是,仅使用 psql 将所有这些操作成可用于恢复的东西并不容易。