Re: How to fully restore a single table from a custom dump?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <shammat(at)gmx(dot)net>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to fully restore a single table from a custom dump?
Date: 2022-08-09 13:27:45
Message-ID: 819154.1660051665@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thomas Kellerer <shammat(at)gmx(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2022-08-09 16:41:33 Re: How to fully restore a single table from a custom dump?
Previous Message Holger Jakobs 2022-08-09 13:21:33 Re: How to fully restore a single table from a custom dump?