Restoring a table with a different name

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Restoring a table with a different name
Date: 2004-02-27 23:19:49
Message-ID: 200402272319.i1RNJnOZ003260@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a 600K row table on my production system (running 7.3.3)
that I dump and load on my development system (7.4.1) every night using
cron jobs.

I would like to be able to restore the table under a different table name
without first having to play games with the development copy of the table.

If I edit the dump file with 'sed' to change the table name, I get
'invalid command \N' errors trying to reload it.

If I create the dump using inserts instead of load, inserting 600K
records takes too long.

The best solution I've come up with so far is to copy the table on the
production system to the new table name, then dump and restore it.

Is there an easier way to do this?
--
Mike Nolan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2004-02-27 23:20:17 clear defunct entries from pg_stat_activity
Previous Message Bill Moran 2004-02-27 23:16:28 Re: efficient storing of urls