I'm using Postgres 8.4 and I want to dump database structure (no data). Is is possible to get each object (table, view, function etc.) in a separate file, NOT EVERYTHING in one file???
-
You can check my answer in this other post from SO : stackoverflow.com/questions/58869245R. Du– R. Du2020-04-02 10:06:50 +00:00Commented Apr 2, 2020 at 10:06
-
github.com/omniti-labs/pg_extractor does thisGajus– Gajus2023-10-24 18:01:46 +00:00Commented Oct 24, 2023 at 18:01
Add a comment
|
1 Answer
Use newer version of pg_dump (at least version 9.1) and you can dump to a directory using --format=directory
This will create a directory with one file for each table and blob being dumped
1 Comment
joop
The separate files are only used for the data, with
--schema-only the complete DDL is still compressed into the TOC. (could be possible to extract the parts by applying a script, though)