Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docs:postgres:pg_dump [2008/01/15 10:27] – billh | docs:postgres:pg_dump [2009/04/16 11:51] (current) – billh | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Tips ===== | ===== Tips ===== | ||
* you may need to specify the -i flag, to ignore differences in the database version and pg_dump executable; if this is done, it might be best to use a plain text format for the dump to be safe | * you may need to specify the -i flag, to ignore differences in the database version and pg_dump executable; if this is done, it might be best to use a plain text format for the dump to be safe | ||
+ | * the -d flag does not specify a database, but rather specifies that you want INSERT statements instead of COPY statements | ||
===== Examples ===== | ===== Examples ===== | ||
- | **Dump all tables, with acl/ | + | **Dump all tables, with acl/ |
< | < | ||
pg_dump --file=/ | pg_dump --file=/ | ||
Line 14: | Line 15: | ||
< | < | ||
pg_dump --data-only --file=/ | pg_dump --data-only --file=/ | ||
- | --table=sometable --no-privileges --disable-triggers -h hostname | + | --table=sometable --no-privileges --disable-triggers -h hostname database |
+ | </ | ||
+ | |||
+ | ** Dump database schema, without owners or permissions: | ||
+ | < | ||
+ | pg_dump --schema-only --no-owner --no-privileges -h hostname -U username databasename > dumpfile.sql | ||
</ | </ |