user1802143
user1802143

Reputation: 15682

copy tables/fields of postgreSQL database

I'd like to create a new database with the same tables/fields as an existing database. I don't need any of the rows, I just need the schema. Is there a way to do this?

Upvotes: 0

Views: 44

Answers (1)

Joshua Moore
Joshua Moore

Reputation: 24776

You can copy just the schema using pg_dump, then restore it in your new database.

pg_dump --schema-only

Upvotes: 1

Related Questions