postgresql 如何在postgresql中将数据从一个数据库复制到另一个数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6016065/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-20 23:00:59  来源:igfitidea点击:

how to copy data from one database to another database in postgresql?

databasepostgresql

提问by sda

I am trying to copy tables from one postgresql8.4 to another postgresql8.4 and I am not sure how do I do that?

我正在尝试将表从一个 postgresql8.4 复制到另一个 postgresql8.4,但我不知道该怎么做?

采纳答案by pugmarx

Can't you just take pg_dumpfrom one and import in another? Seems quite trivial.
Take a look at this: http://www.postgresql.org/docs/8.4/static/backup-dump.html

你不能只pg_dump从一个中取出并导入另一个吗?看起来很琐碎。
看看这个:http: //www.postgresql.org/docs/8.4/static/backup-dump.html

回答by Aashi Deacon

if you have postgres contrib installed you need to type this once is psql:

如果你安装了 postgres contrib,你需要输入一次 psql:

CREATE EXTENSION dblink;

创建扩展数据库链接;

回答by StevieG

You should be able to so it using a database link:

您应该能够使用数据库链接来实现它:

http://www.postgresql.org/docs/8.4/static/contrib-dblink.html

http://www.postgresql.org/docs/8.4/static/contrib-dblink.html