Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oLe2p-0000pC-33 for pgsql-admin@arkaria.postgresql.org; Wed, 10 Aug 2022 05:14:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oLe2n-0000Rt-UJ for pgsql-admin@arkaria.postgresql.org; Wed, 10 Aug 2022 05:14:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oLe2n-0000Rk-IV for pgsql-admin@lists.postgresql.org; Wed, 10 Aug 2022 05:14:13 +0000 Received: from mout.gmx.net ([212.227.15.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oLe2h-0002gD-Dm for pgsql-admin@postgresql.org; Wed, 10 Aug 2022 05:14:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1660108446; bh=cZ3J0orp8LVSYi48MI5ZYA5sAB2A2pM7y7CCRLSTu4g=; h=X-UI-Sender-Class:Subject:Cc:References:From:Date:In-Reply-To; b=jHoQ1MswcxZWzWCKv/069PstXKYpoI7Rn+4DVmtzngRNK45rj3fvQXUFOVFOCruO+ Axr7w21ZBiZZlWC+ypzXRWgFCDcwSOgK+QDm992p8zPtWb8QVRLr1ehM/Go2KruEfp 5rH9H6TQinTYrmaUkJsz/ainTcTnvJ+SP2uTk/+c= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.8.0.56] ([185.40.248.10]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDNl-1nbnIv0srH-00qkNS for ; Wed, 10 Aug 2022 07:14:06 +0200 Subject: Re: How to fully restore a single table from a custom dump? Cc: pgsql-admin References: <819154.1660051665@sss.pgh.pa.us> From: Thomas Kellerer Message-ID: Date: Wed, 10 Aug 2022 07:14:06 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <819154.1660051665@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:mP6RCy20+oa8c7g1NbPrMsIPsRrzdAPoRIzfNPHEmvoFa/FEIf6 cotj4Xsjkjw5CGqWFaEHetUrgu9MXRkFcXXnFXbClIgUYHQxYUQ9KnIGghJSKlTXtYZQJf0 wfst11JMZU03v+F9Aw5mk26H7fsF5yXBPgMHtscUaMtb+29reyvqKmPwy1uE63QOVa1wSya H2DqIxXU1kOuDOjQcPmnA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:x6dNsKF1D0Y=:gqA+WyqCfTXminnKVL1WNq ekJ/qUQpXu33w+ynW3cP4N5OPdQ7xG3sgCipypsqAucHeRjzkov6vmKGYQvv9BHOFK5TzrTiQ AIGvSXyzxTgWZyCNwX+par74SDklle7DkSPCKUmHefdaVoE7UjfTlGotHhOwofCnnH077MxGr njxCrL+5WDkusDUc6PektxV/yOsb+YPCkQAD2wAhZzezvTMcs7Ut7wyXd6ltUQpPXMzOBkVi+ Zvo9nZ51PbvwwA7DaWIyN6oElfqHYPsc8WIRCWgDvnyb4LdoT+YYfZwlRvQ8e4QvlW3q1Yab5 vG3FMS3FNuZaT/6sa0i8t2VyoV+vEhQeuLlDsJPTZvTPoTOzUwfz3nlOo8kilsCvBtGd/b2xd lVxV2NMx+7B2IvLRquDQrtItycwCMZau485BoIvMI7vBl3ba6H3g5bdY5l3g6TqdjO8duRaFE FZF6vPDDpsvFZmWvyxHTAEt2fEYg5vTkGPaJUJhQU4SbvsqINt1kBM+PZ9FQv5ynX8XeZZuD2 6/vrXLCAdUXyVnRflH1/KveTj0bwUj+WIrZ379fgVRDJPm2bXPGqfotMm20eXWYSoVmTg87fA 2gp8BFaeWNglN3o5AdZ6GJRNNZzN35Cjm/3MTdeCVPX04rqxu04mu9UAEEATrhRURi3W1Obnl iyNV4xVuk3Pu6eP8QppjGAmEttZWh+MJQ32oQh1KMw3l5qYbpqEEyFs8/Mg9yVzI7fXWCbR3W Ol5HJzpl+YVh9uDoA37kGvJF1zOAsGd5pZu8kE88e619lExufR2DExsJMSCuqhuGyQhI4qGWf YJt+mqasoHgHIwR/ENVZtHRvOi++vSNzItNqad/akRbXZJ0fg6Qse26pBlcCBY1kG60WWHY3a mRLA8Cik5Vv50DWk2tVe1SDi2B/gQho2+5nC5Vt0G+rw/FPh8z0K53bIpBoOyk8RL8bZsgVX8 CS+AOc3Ntataj3xXqeujcLxow7kWI4g7uFQinm2qNT0+Z+pdIznYAm6WGyshbTVrMRt0OSQ2B IdfS2ph3HdRhCe2wTL3hSZsO2FsIvoWzSIzPj9xCdcKiW7ycxQwxBC88yxQHLFYLayo9XL0aw PBuZzwyicg0cVRF1ygLynFFbPjnYOIcE5T32GJiBpK11Za7CbZPUrR3eA== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom Lane schrieb am 09.08.2022 um 15:27: > Thomas Kellerer 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.