Suggested enhancement to pg_restore

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Suggested enhancement to pg_restore
Date: 2011-07-26 22:48:09
Message-ID: CAOzAquJ48+TZLmpaCUCfE0J3ugyn_efTr+-vnWq2s5wDVhaxTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I suggest adding the following parameter to pg_restore:

--rename-table=XXXX

When used in conjunction with the --data-only, --schema and -t options (all
three of which would be necessary),
it would allow restoring a table (without indexes) to a different table name
(which would need to already exist
and match the structure of the table which is being restored, of course.)

This would give PostgreSQL users the ability to reload a table from a dump
file to a separate table name in the
same database and schema.

In other words, this command:

pg_restore --data-only --schema=abc -t xyz --rename-table=xyz_copy

would restore a copy of table xyz into the existing (and presumably empty)
table xyz_copy, leaving table xyz untouched.
--
Mike Nolan
nolan(at)tssi(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2011-07-26 22:53:55 Re: 100 times faster than mysql
Previous Message Greg Smith 2011-07-26 22:46:34 Re: heavy load-high cpu itilization