From 8977b68a42e41252b13364c92a86a0a42c83c72e Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 1 Aug 2006 18:05:04 +0000 Subject: Allow multiple -n (schema) and -t (table) pg_dump options, and add -T and -N options to exclude objects. Also support regular expressions for option object names. Greg Sabino Mullane --- doc/src/sgml/ref/pg_dump.sgml | 97 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 150bf7b0f68..baa23d1e5e5 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,5 +1,5 @@ @@ -398,24 +398,107 @@ PostgreSQL documentation Dump data for table - only. It is possible for there to be - multiple tables with the same name in different schemas; if that - is the case, all matching tables will be dumped. Specify both - + + The options + + For example, to dump a single table named pg_class: + + +$ pg_dump -t pg_class mydb > db.out + + + + To dump all tables starting with employee in the + detroit schema, except for the table named employee_log: + + +$ pg_dump -n detroit -t ^employee -T employee_log mydb > db.out + + + + To dump all schemas starting with east or west and ending in + gsm, but not schemas that contain the letters test, except for + one named east_alpha_test_five: + + +$ pg_dump -n "^(east|west).*gsm$" -N test -n east_alpha_test_five mydb > db.out + + + + + To dump all tables except for those beginning with ts_: + + +$ pg_dump -T "^ts_" mydb > db.out + + + + In this mode, pg_dump makes no - attempt to dump any other database objects that the selected table + attempt to dump any other database objects that the selected tables may depend upon. Therefore, there is no guarantee - that the results of a single-table dump can be successfully + that the results of a specific-table dump can be successfully restored by themselves into a clean database. + + + + + + Do not dump any matching tables. + More than one option can be used, and POSIX regular expressions are handled just + like -t. + + + + + + + + + + Dump only the matching schemas. + More than one option can be used, and POSIX regular expressions are handled just + like -t. + + + + + + + + + + + Do not dump the matching schemas. + More than one option can be used, and POSIX regular expressions are handled just + like -t. + + + + + -- cgit v1.2.3