From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: How to fully restore a single table from a custom dump?
Date: Tue, 09 Aug 2022 09:27:45 -0400
Message-ID: <819154.1660051665@sss.pgh.pa.us> (raw)
In-Reply-To: <e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net>
References: <e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net>
Thomas Kellerer <shammat@gmx.net> writes:
> Any ideas, how I can _fully_ restore a single table from a custom dump?
"pg_restore -l -v" will give you a table-of-contents with
dependencies, like this:
8155; 0 40431 MATERIALIZED VIEW DATA public analytics_materialized_view postgres
; depends on: 960 8161
This is object number 8155 and it depends on objects 960 and 8161.
Find the table you want, then look for things with dependencies
on it (some of them may not be things you want to restore).
Edit away all the lines for things you don't want, then feed
the reduced list to "pg_restore -L".
regards, tom lane
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: tgl@sss.pgh.pa.us, shammat@gmx.net
Subject: Re: How to fully restore a single table from a custom dump?
In-Reply-To: <819154.1660051665@sss.pgh.pa.us>
* 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