brigantaggior
brigantaggior

Reputation: 108

How to get a full list of schemas in pg_dump?

How can I get a full list of schemas in known database Postgresql in pg_dump utility to backup each schema in a separate file?

Now I use it in this way:

# pg_dump my_database

Upvotes: 1

Views: 1566

Answers (1)

Dwayne Towell
Dwayne Towell

Reputation: 8623

Try

psql -c "select schema_name from information_schema.schemata" -At

to return just the names, i.e., suitable for shell scripting.

Upvotes: 2

Related Questions