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.
3 Answers
- right click on a table/schema/database and click 'Backup' in the menu.
- set export file format to 'Plain'
- select the custom file created to save the backup scripts
and double click to confirm
- open 'dump options' tab to set dump options
- set dump options
- set 'Use INSERT commands' so the exported sql is runnable when original table/schema/database is deleted
- click 'Backup' button to start process
- PgAdmin shows success message when backup is done
Comments
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"
2: At top of right panel, "Generate SQL".
1 Comment
Rexy
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.












