PostgreSQL: Generate full Database Script using PGAdmin Tool

Before few days back, One of the SQL Server Developer asked me this question.
How to generate full database schema script or data script in PostgreSQL?

In PostgreSQL, We can also generate Database full script using Backup Option of PGAdmin tool.
When we require to create a fresh database without data, mostly we require to generate Database Schema Script.
We have one PLAIN text database backup type in PostgreSQL, which creates .sql file including Schema + Data.

Below are screenshots to generate Database Script using PGAdmin Tool:

Step 1:
Right click on the database and select backup option.
In backup dialog box, select PLAIN backup type and give a file name.

Postgresql Plain Text Backup

Step 2:
Default PLAIN text backup included both Database Schema + Data script.
In case of any changes, go to dump option tab and select data or schema only.

Postgresql Plain Data Schema Option

Step 3:
If you want to filter your objects, go to object tab and check or unchecked objects from the list.

Postgresql Plain Backup Object Selection

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

Be the First to Comment!

Notify of