From cjwhite@cisco.com Fri Aug 1 15:18:11 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CA479D1C4D5 for ; Fri, 1 Aug 2003 15:18:11 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 48037-09 for ; Fri, 1 Aug 2003 12:17:02 -0300 (ADT) Received: from sj-core-4.cisco.com (sj-core-4.cisco.com [171.68.223.138]) by svr1.postgresql.org (Postfix) with ESMTP id 761C4D1C4E6 for ; Fri, 1 Aug 2003 12:18:09 -0300 (ADT) Received: from cjwhitew2k01 ([128.107.172.176]) by sj-core-4.cisco.com (8.12.6/8.12.6) with ESMTP id h71FI6pp010803 for ; Fri, 1 Aug 2003 08:18:07 -0700 (PDT) Reply-To: From: "Chris White (cjwhite)" To: Subject: Problem restoring large objects with pg_restore Date: Fri, 1 Aug 2003 08:18:43 -0700 Message-ID: <000201c35840$32156500$5c976b80@amer.cisco.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0003_01C35805.85B68D00" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50 X-Spam-Level: X-Archive-Number: 200308/23 X-Sequence-Number: 9746 This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C35805.85B68D00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I am running version 7.2.1 of postgres and I am trying to restore all the large objects and associated tables from a backup I took 3 days ago. I created a restore list using pg_restore -l restore.file > restore.list command. I then edited the restore list to only include those tables I needed. Then I restored the tables and large objects using the pg_restore -c -d database -U user -L restore list restore.file Everything got restored, all the requested tables and all the large objects. However, all the large objects were restored with a different oids (some using oids of previous large objects), which made all the references to these oids in the tables incorrect. What did I do wrong? Chris White ------=_NextPart_000_0003_01C35805.85B68D00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
I am runn= ing version=20 7.2.1 of postgres and I am trying to restore all the large objects and=20 associated tables from a backup I took 3 days ago. I created a restore list= =20 using
 
pg_restor= e -l=20 restore.file > restore.list
 
command. = I then=20 edited the restore list to only include those tables I needed. Then I resto= red=20 the tables and large objects using the
 
pg_restor= e -c -d=20 database -U user -L restore list restore.file
 
Everythin= g got=20 restored, all the requested tables and all the large objects. However, all = the=20 large objects were restored with a different oids (some using oids of previ= ous=20 large objects), which made all the references to these oids in the tables= =20 incorrect.
 
What did = I do=20 wrong?
 
Chris=20 White
------=_NextPart_000_0003_01C35805.85B68D00-- From tgl@sss.pgh.pa.us Fri Aug 1 16:40:27 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7481BD1C50C for ; Fri, 1 Aug 2003 16:40:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 55288-06 for ; Fri, 1 Aug 2003 13:39:19 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 8365BD1C4E6 for ; Fri, 1 Aug 2003 13:40:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h71GeJQ3016200; Fri, 1 Aug 2003 12:40:19 -0400 (EDT) To: cjwhite@cisco.com Cc: pgsql-admin@postgresql.org Subject: Re: Problem restoring large objects with pg_restore In-reply-to: <000201c35840$32156500$5c976b80@amer.cisco.com> References: <000201c35840$32156500$5c976b80@amer.cisco.com> Comments: In-reply-to "Chris White (cjwhite)" message dated "Fri, 01 Aug 2003 08:18:43 -0700" Date: Fri, 01 Aug 2003 12:40:18 -0400 Message-ID: <16199.1059756018@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/29 X-Sequence-Number: 9752 "Chris White (cjwhite)" writes: > Everything got restored, all the requested tables and all the large > objects. However, all the large objects were restored with a different > oids (some using oids of previous large objects), That's what's expected to happen. There is no way for pg_restore to force them to have the same OIDs as before. > which made all the > references to these oids in the tables incorrect. pg_restore is supposed to take care of updating references to restored large objects. Perhaps you were storing the references as the wrong datatype (not OID or LO)? Or perhaps you tried to do the restore in multiple pg_restore runs? I'm not certain, but I think pg_restore may only look at tables restored in the current run for references to update. For sure it can't fix tables you haven't restored yet. regards, tom lane