168

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.

2

3 Answers 3

243
  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

Edit: In case you are using pgAdmin on a remote server: Once the UI announces the backup was successful, you might want to download the data. For this, follow these steps:

  1. Click on Tools (in the menu)
  2. Select Storage Manager
  3. Select the file that was just created
  4. Click on the small "Download File" button
Sign up to request clarification or add additional context in comments.

8 Comments

where this backup went?
Maybe this work if your DB is in local. In my case, there is a message announcing the victory, but the file disappears on the server. I want to DOWNLOAD it on my computer. :/
pgAdmin is most ridiculous IT tools I've ever used. There's anything like UX in pgAdmin.
I couldn't find the file that was generated, so I ended up using the command that pgAdmin used (click on "More Details" in pgAdmin after running Backup), and opening a shell on the server and running the same command, then I could copy the file.
for File Name give a file with a full path (eg: /home/xxx/yyy/backup.sql"), Then if it gives an error saying cannot find that message has the default path it tries to save.
|
168

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.

10 Comments

it generates dump having table data script starts with COPY command not INSERT. Anyway to generate script with INSERT commands.
That's why you have to create plain SQL. When using the dump option INSERT, you get ordinary INSERT queries
@Pixel Elephant: If performance matters, you should use COPY. It's much faster.
In pgAdmin III 1.16.1, "Use Insert commands" is under Dump Option #2.
In pgAdmin III 1.18.1, Select Plain for Format under File Option and than check "Use Insert commands" under Dump Option #2.
|
24

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.