Re: pg_restore single table privileges/indexes

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_restore single table privileges/indexes
Date: 2007-02-06 17:47:15
Message-ID: 200702060947.16089@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 06 February 2007 09:32, Jeff Amiel <becauseimjeff(at)yahoo(dot)com>
wrote:
> We just switched from 'pg_dumpall" to "pg_dump -format=c" for our nightly
> backups. I wanted to experiment with restoring a single table (if the
> need should ever arise) from the dump file.

> I also notice that the indexes are not restored...that I understand. I
> guess I have to do separate --index for each index on the table, correct?
>
> Any help would be appreciated.

You can extract the full table of contents from the custom dump
(pg_restore --list dump_file), then extract just the lines relevant to your
table and use those to restore (or at least identify the objects to
restore). You'll find the ACL's, indexes, foreign keys and triggers all on
different lines.

--
Ginsberg's Theorem:
1) You can't win.
2) You can't break even.
3) You can't quit the game.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-02-06 17:48:38 Re: Cursor timeout in postgres
Previous Message John McCawley 2007-02-06 17:38:04 Creating an index on a live database