pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: How to fully restore a single table from a custom dump?
Date: Tue, 9 Aug 2022 14:06:03 +0200
Message-ID: <e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net> (raw)

Hello,

I just realized that using

   pg_restore -t some_table ... some_dump_file

doesn't restore things like identity attributes
or indexes on the specified table.

The dump contains much more than just that table, so simply
using pg_restore without -t is not an option.

While I could extract the indexes manually using some clever regex
on the index names, I don't see a way to make sure that identity
definitions (or sequence values) are restored properly for the selected table.

Any ideas, how I can _fully_ restore a single table from a custom dump?

Thomas





view thread (10+ messages)  latest in thread

Message-ID: <e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net>
Permalink:  ../e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net/
Also on:    postgresql.org/message-id/e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: shammat@gmx.net
  Subject: Re: How to fully restore a single table from a custom dump?
  In-Reply-To: <e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox