postgresql 将数据从一个数据库传输到另一个数据库 (Postgres)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2802736/
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
Transferring data from one database to another (Postgres)
提问by Gandalf StormCrow
I have 2 exactly same databases on 2 different machines(with different data that is), and I want to transfer contents of one table to the table from the other database, how do I do that from PgAdmin? I'm new to PostgreSQL Database, I'd do that easily with mysql phpmyadmin just export sql and I'd get text file with bunch of insert into statements, is there equivalent with PgAdmin ?
我在 2 台不同的机器上有 2 个完全相同的数据库(具有不同的数据),我想将一个表的内容从另一个数据库传输到该表,我该如何从 PgAdmin 执行此操作?我是 PostgreSQL 数据库的新手,我可以用 mysql phpmyadmin 轻松做到这一点,只需导出 sql,我就会得到带有插入语句的文本文件,是否与 PgAdmin 等效?
采纳答案by Milen A. Radev
Yes, backupusing "PLAIN" format (SQL statements) and then (when connected to the other DB) open the file and run it.
是的,使用“PLAIN”格式(SQL 语句)备份,然后(当连接到其他数据库时)打开文件并运行它。
Or you could select "COMPRESS" format in the "backup" dialogue, and then you could use the restoredialogue.
或者您可以在“备份”对话框中选择“压缩”格式,然后您可以使用恢复对话框。
Also there's an equivalent of phpMyAdmin for Postgres, called "phppgadmin". Select the table in question and then use the "Export" tab.
还有一个相当于 Postgres 的 phpMyAdmin,称为"phppgadmin"。选择有问题的表格,然后使用“导出”选项卡。