pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 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: Wed, 10 Aug 2022 07:14:06 +0200
Message-ID: <a4428a67-51c5-8e84-c0de-8c803ea02edf@gmx.net> (raw)
In-Reply-To: <819154.1660051665@sss.pgh.pa.us>
References: <e434fe3f-0159-2223-8670-411d5c21c5bd@gmx.net>
	<819154.1660051665@sss.pgh.pa.us>

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


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






view thread (10+ messages)

Message-ID: <a4428a67-51c5-8e84-c0de-8c803ea02edf@gmx.net>
Permalink:  ../a4428a67-51c5-8e84-c0de-8c803ea02edf@gmx.net/
Also on:    postgresql.org/message-id/a4428a67-51c5-8e84-c0de-8c803ea02edf@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: <a4428a67-51c5-8e84-c0de-8c803ea02edf@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