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

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To:
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-10 05:14:06
Message-ID: a4428a67-51c5-8e84-c0de-8c803ea02edf@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Tom Lane schrieb am 09.08.2022 um 15:27:
> 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".

Ah, thanks. I wasn't aware that -v would include dependencies.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message richard coleman 2022-08-10 21:08:40 postgresql definitive list of network resources used/needed?
Previous Message Ron 2022-08-09 20:25:13 Re: How to fully restore a single table from a custom dump?