database 使用 pgAdmin 导出 Postgresql 表数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11257132/
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-09-08 08:36:23  来源:igfitidea点击:

Export Postgresql table data using pgAdmin

databasepostgresqlexportpgadmin

提问by Muhammad Imran Tariq

I am using pgAdmin version 1.14.3. PostgreSQL database version is 9.1.

我正在使用 pgAdmin 版本 1.14.3。PostgreSQL 数据库版本为 9.1。

I got all Db script for table creation but unable to export all data inside tables. Could not find any option to export data in db script form.

我获得了用于表创建的所有 Db 脚本,但无法导出表中的所有数据。找不到任何以 db 脚本形式导出数据的选项。

回答by Yusuf

  1. Right-click on your table and pick option Backup..
  2. On File Options, set Filepath/Filename and pick PLAINfor Format
  3. Ignore Dump Options #1 tab
  4. In Dump Options #2 tab, check USE INSERT COMMANDS
  5. In Dump Options #2 tab, check Use Column Insertsif you want column names in your inserts.
  6. Hit Backupbutton
  1. 右键单击您的表并选择选项Backup..
  2. 在文件选项上,设置文件路径/文件名并选择PLAIN格式
  3. 忽略转储选项 #1 选项卡
  4. 在转储选项 #2 选项卡中,检查 USE INSERT COMMANDS
  5. 在转储选项 #2 选项卡中,检查Use Column Inserts您是否希望插入中的列名。
  6. 点击Backup按钮

回答by Frank Heikens

Just right click on a table and select "backup". The popup will show various options, including "Format", select "plain" and you get plain SQL.

只需右键单击一个表并选择“备份”。弹出窗口将显示各种选项,包括“格式”,选择“普通”,您将获得普通的 SQL。

pgAdmin is just using pg_dumpto create the dump, also when you want plain SQL.

pgAdmin 只是使用pg_dump来创建转储,当您需要纯 SQL 时也是如此。

It uses something like this:

它使用这样的东西:

pg_dump --user user --password --format=plain --table=tablename --inserts --attribute-inserts etc.

pg_dump --user user --password --format=plain --table=tablename --inserts --attribute-inserts 等。

回答by Keyur

In the pgAdmin4, Right click on table select backup like this

在 pgAdmin4 中,右键单击表选择备份,如下所示

enter image description here

在此处输入图片说明

After that into the backup dialog there is Dump optionstab into that there is section queries you can select Use Insert Commandswhich include all insert queries as well in the backup.

之后进入备份对话框,有转储选项选项卡,其中有部分查询,您可以选择使用插入命令,其中包括备份中的所有插入查询。

enter image description here

在此处输入图片说明