Lajos Arpad
Lajos Arpad

Reputation: 76968

How to export schema only for Postgres

I have a very big PostgresSQL database. I would like to dump the schema only. Running

pg_dump -s myschema -f /dump.sql

runs forever, so I suppose it is exporting the data as well. How can I dump the schema only?

Upvotes: 1

Views: 5532

Answers (1)

user330315
user330315

Reputation:

-s takes no parameter, you need to use -n or --schema to select the schema you want to dump:

pg_dump -s -n myschema -d mydatabase -f /dump.sql

Upvotes: 6

Related Questions