1

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?

1 Answer 1

6

-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 
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the answer. Will this avoid dumping the data?
@LajosArpad, yes it will
It's still running... Sorry for the slow reply.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.