On Fri, Aug 19, 2016 at 12:38 PM, Jim Nasby <jim.na...@bluetreble.com>
wrote:

> On 8/18/16 5:01 PM, Tom Lane wrote:
>
>> I agree, but I think mandating a database name (which I suppose could be
>>> > *) with the specifiers would solve that issue.
>>>
>> Hmm, something like "-T dbname1:pattern1 -T dbname2:pattern2" ?
>>
>
> Bingo. Hopefully there'd be some way to consolidate the code between the
> two as well...
> --
> Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
> Experts in Analytics, Data Architecture and PostgreSQL
> Data in Trouble? Get it in Treble! http://BlueTreble.com
> 855-TREBLE2 (855-873-2532)   mobile: 512-569-9461
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


After review, I realized that there is a call to the function:
doShellQuoting (pgdumpopts, OPTARG), which no longer seems to exist ...
After understand the code, I saw that the call is appendShellString (
pgdumpopts, OPTARG).

Follow the patches already with the necessary corrections.

Regards
*Gerdan Rezende dos Santos *
*Po*stgreSQL & EnterpriseDB Specialist, Support, Training & Services
+55 (61) 9645-1525
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index a7dc41c..979a964 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -111,6 +111,7 @@ main(int argc, char *argv[])
 		{"password", no_argument, NULL, 'W'},
 		{"no-privileges", no_argument, NULL, 'x'},
 		{"no-acl", no_argument, NULL, 'x'},
+		{"exclude-table", required_argument, NULL, 'T'},
 
 		/*
 		 * the following options don't have an equivalent short option letter
@@ -195,7 +196,7 @@ main(int argc, char *argv[])
 
 	pgdumpopts = createPQExpBuffer();
 
-	while ((c = getopt_long(argc, argv, "acd:f:gh:l:oOp:rsS:tU:vwWx", long_options, &optindex)) != -1)
+	while ((c = getopt_long(argc, argv, "acd:f:gh:l:oOp:rsS:tU:vwWxT:", long_options, &optindex)) != -1)
 	{
 		switch (c)
 		{
@@ -283,6 +284,11 @@ main(int argc, char *argv[])
 				appendPQExpBufferStr(pgdumpopts, " -x");
 				break;
 
+			case 'T':
+				appendPQExpBufferStr(pgdumpopts, " -T");
+				appendShellString(pgdumpopts, optarg);
+				break;
+
 			case 0:
 				break;
 
@@ -564,6 +570,7 @@ help(void)
 	printf(_("  -s, --schema-only            dump only the schema, no data\n"));
 	printf(_("  -S, --superuser=NAME         superuser user name to use in the dump\n"));
 	printf(_("  -t, --tablespaces-only       dump only tablespaces, no databases or roles\n"));
+	printf(_("  -T, --exclude-table          exclude some tables\n"));
 	printf(_("  -x, --no-privileges          do not dump privileges (grant/revoke)\n"));
 	printf(_("  --binary-upgrade             for use by upgrade utilities only\n"));
 	printf(_("  --column-inserts             dump data as INSERT commands with column names\n"));
-- 
diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml
index 6c34c25..24408b9 100644
--- a/doc/src/sgml/ref/pg_dumpall.sgml
+++ b/doc/src/sgml/ref/pg_dumpall.sgml
@@ -198,6 +198,20 @@ PostgreSQL documentation
      </varlistentry>
 
      <varlistentry>
+      <term><option>-T <replaceable class="parameter">table</replaceable></option></term>
+      <term><option>--exclude-table=<replaceable class="parameter">table</replaceable></option></term>
+      <listitem>
+       <para>
+        Do not dump any tables matching the <replaceable
+        class="parameter">table</replaceable> pattern.  The pattern is
+        interpreted according to the same rules as for <option>-t</>.
+        <option>-T</> can be given more than once to exclude tables
+        matching any of several patterns.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry>
       <term><option>-v</></term>
       <term><option>--verbose</></term>
       <listitem>
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to