Given an existing database in PostgreSQL, I want to get the required SQL code to generate an identical database with no records.
Is there any easy way to do so?
You can use pg_dump
command to do that. The option -s
dumps only the schema and no data from the database.