Export Postgresql table data using pgAdmin

DatabasePostgresqlExportPgadmin

Database Problem Overview


I am using pgAdmin version 1.14.3. PostgreSQL database version is 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.

Database Solutions


Solution 1 - Database

  1. Right-click on your table and pick option Backup..
  2. On File Options, set Filepath/Filename and pick PLAIN for 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 Inserts if you want column names in your inserts.
  6. Hit Backup button

Solution 2 - Database

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

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

It uses something like this:

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

Solution 3 - Database

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

enter image description here

After that into the backup dialog there is Dump options tab into that there is section queries you can select Use Insert Commands which include all insert queries as well in the backup.

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMuhammad Imran TariqView Question on Stackoverflow
Solution 1 - DatabaseYusufView Answer on Stackoverflow
Solution 2 - DatabaseFrank HeikensView Answer on Stackoverflow
Solution 3 - DatabaseKeyur LakhaniView Answer on Stackoverflow