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:
Right click on the database and select backup option.
In backup dialog box, select PLAIN backup type and give a file name.
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.
If you want to filter your objects, go to object tab and check or unchecked objects from the list.
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 dbrnd.com, 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.