Skip site navigation (1) Skip section navigation (2)

Re: Multiple --table options for other commands

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multiple --table options for other commands
Date: 2012-10-31 03:14:19
Message-ID: CAK3UJRGSkO+Wo_8Rat1UquQYCMZGH=xh+n3Z=zen1kdJ2PJ_ug@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun, Oct 28, 2012 at 4:30 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)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: multiple_tables.v1.diff
Description: application/octet-stream (23.6 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Amit KapilaDate: 2012-10-31 03:33:39
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL
Previous:From: Shigeru HanadaDate: 2012-10-31 01:20:07
Subject: Re: Move postgresql_fdw_validator into dblink

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group