Reputation: 1366
With MySql Workbench, I could create all tables of a database with EER-Diagram, and then do File/Export/Forward Engineer SQL Create Script to generate a sql file that creates the db plus all tables of the db. In Postgresql, with pgAdmin4 or DBeaver, I have created all tables under database/schema, is there any similar way to generate a sql file to create the db and all tables of the db?
Upvotes: 4
Views: 9831
Reputation: 9656
You export only schema without data
using pg_dump
in psql [terminal]
:
pg_dump -U postgres -s databasename > backup.sql
or with Pgadmin4
only schema
in the Dump option
.Upvotes: 3