I want to create re-runnable DDL script for PostgreSQL database. I have done this for SQL server using SSMS. SSMS can generate DDL statements for a database with "if not exists" condition.
How can we do this for PostgreSQL?
I want to generate DDL statements for one of my PostgreSQL database and want to run it on another database so that I can create all the tables on target database also. However, DDL Script should have "IF Not EXISTS" for each table so that I don't get any error if the script is run multiple times.
Is there any tool which can automatically create Such DDL Statements for a database for Postgresql?