Mathias Hillmann
Mathias Hillmann

Reputation: 1837

Postgres Dumping database with only some schemas

I have a database called supre with the following schemas cdu, beirario, lider, koch, public, however I would like to dump the database with only the schemas cdu, beirario, public.

Following postgres' documentation I found the -s flag, however that states that it only dumps the schema and a pg_restore wouldn't work with only that.

How can I achieve this?

Upvotes: 0

Views: 57

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247665

Use the -n option:

pg_dump -n cdu -n beirario -n lider ... dbname

Upvotes: 1

Related Questions