Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top