11

I read a few similar posts and find that they did not specify how to export SQLs to custom files. I will walk through steps with screenshots here.

reference reference

3 Answers 3

21
  1. right click on a table/schema/database and click 'Backup' in the menu.

enter image description here

  1. set export file format to 'Plain'

enter image description here

  1. select the custom file created to save the backup scripts

enter image description here

and double click to confirm

enter image description here

  1. open 'dump options' tab to set dump options

enter image description here

  1. set dump options

enter image description here

enter image description here

  1. set 'Use INSERT commands' so the exported sql is runnable when original table/schema/database is deleted

enter image description here

  1. click 'Backup' button to start process

enter image description here

  1. PgAdmin shows success message when backup is done

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

7

Neither of the other solutions on this post are what I needed.

To generate all of my tables' creation SQL, I prefer the method of:

1: Right click on Schema field in left panel, select "Create ERD for Schema"

Right Click on Schema, Select "Create ERD For Schema"

2: At top of right panel, "Generate SQL".

Alt+Ctrl+S

1 Comment

In my case, this answer is more useful than the others as it seems to generate the plain CREATE TABLE command, including the inherited columns, whereas the SQL from other answers include INHERITS (...) after the CREATE TABLE so you have to manually add the columns from the inherited table.
3

There is a Store Manager under Tools that allows you to download a backup explained in the answer above. Took me a while to find it. Hope this helps.

enter image description here

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.