Re: Multiple --table options for other commands - Mailing list pgsql-hackers

From Josh Kupershmidt
Subject Re: Multiple --table options for other commands
Date
Msg-id CAK3UJRGSkO+Wo_8Rat1UquQYCMZGH=xh+n3Z=zen1kdJ2PJ_ug@mail.gmail.com
Whole thread Raw
In response to Multiple --table options for other commands  (Josh Kupershmidt <schmiddy@gmail.com>)
Responses Re: Multiple --table options for other commands  ("Karl O. Pinc" <kop@meme.com>)
List pgsql-hackers
On Sun, Oct 28, 2012 at 4:30 PM, Josh Kupershmidt <schmiddy@gmail.com> wrote:

> I see there's already a TODO for allowing pg_restore to accept
> multiple --table arguments[1], but would folks support adding this
> capability to various other commands which currently accept only a
> single --table argument, such as clusterdb, vacuumdb, and reindexdb?

I went ahead and cooked up a patch to allow pg_restore, clusterdb,
vacuumdb, and reindexdb to accept multiple --table switches. Hope I
didn't overlook a similar tool, but these were the only other commands
I found taking a --table argument.

If you run, say:
  pg_dump -Fc --table=tab1 --table=tab2 ... |
  pg_restore --table=tab1 --table=tab2 ...

without the patch, only "tab2" will be restored and pg_restore will
make no mention of this omission to the user. With the patch, both
tables should be restored.

I also added support for multiple --index options for reindexdb, since
that use-case seemed symmetrical to --table. As suggested previously,
I moved the SimpleStringList types and functions out of pg_dump.h and
common.c into dumputils.{h,c}, so that the code in ./src/bin/scripts/
could use it.

If there are no objections, I can add the patch to the next CF.

Josh

Attachment

pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: Re: Move postgresql_fdw_validator into dblink
Next
From: Amit Kapila
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL