You can use pg_dump --schema-only --format=plain > dump_file.sql
to dump your schema (db objects without data) into a sql file.
Details here: pg_dump
.
質問
I have a pretty big db in the terms of amount of different db object, not the size. I want to backup it (its structure, scheme). Preferably, I'd like to get the sql code. Of course, I can navigate to each its object and just get it but, as I said, there are a lot of them.
How do I do this easily?
解決
You can use pg_dump --schema-only --format=plain > dump_file.sql
to dump your schema (db objects without data) into a sql file.
Details here: pg_dump
.