How to dump PostgreSQL database structure (each object in separate file)

谁说胖子不能爱 提交于 2020-04-16 02:35:46

问题


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???


回答1:


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



来源:https://stackoverflow.com/questions/40281087/how-to-dump-postgresql-database-structure-each-object-in-separate-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!