X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F2574475CBC for ; Tue, 29 Apr 2003 17:59:02 -0400 (EDT) Received: from mta04.onolab.com (smtp.ono.com [62.42.230.12]) by postgresql.org (Postfix) with ESMTP id 4FA2F475ADE for ; Tue, 29 Apr 2003 17:58:58 -0400 (EDT) Received: from 81-203-14-163.user.ono.com ([81.203.14.163]) by mta04.onolab.com (Netscape Messaging Server 4.15) with ESMTP id HE4L2505.F0E for ; Tue, 29 Apr 2003 23:58:53 +0200 From: Juan Miguel To: pgsql-admin@postgresql.org Subject: Re: Fw: Postgres 7.3, pg_dump, pg_restore and "lo" type Date: Wed, 30 Apr 2003 00:01:34 +0200 User-Agent: KMail/1.5 References: <002701c30de0$07517480$0400a8c0@frijid.net> In-Reply-To: <002701c30de0$07517480$0400a8c0@frijid.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304300001.35071.juanmime@ono.com> X-Spam-Status: No, hits=-22.5 required=5.0 tests=BAYES_20,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/391 X-Sequence-Number: 8546 > Juan - if you look back in the posts to 4/21, you'll see a thread titled > "[ADMIN] trouble migrating large objects from 7.1.3 to 7.3.2". In there, > you'll see I was having a similar problem. I discovered that using the -o > option of pg_dump was causing the tar archiver error. As it turns out, > most people don't need the -o option. > > If you can, I'd try re-running pg_dump & pg_restore without the -o option. > If you can't rerun pg_dump or you really need the -o option for pg_dump, > then I'm not sure how to proceed. I couldn't get it to work either, but > luckily I didn't need it. First, thanks to everybody who tried to help me in this trouble. After thinking a long time, I have found one solution. This solution has steps that are individuals for each database, but are very simple. I remember that I use the version 7.3.0, I think that in 7.3.2, some steps could be jumped. Here is, how to restore a database dump, in Postgres 7.3, that uses the "lo" type of the contrib dir. I explain the steps of this "algorithm" for everybody who have the same problem as me. MAKING THE BACKUP ----------------------------------- 1. We have the dump in a tar file, made with something similar to: pg_dump -Ft -o -b -U myuser mydb > backup.tar THE RESTORING PROCESS -------------------------------------------- 2. We drop de database, if it exists. dropdb -U myuser mydb 3. We restore the structure of the database and create it. Use something similiar to: pg_restore -Ft -v -s -C -U myuser -d test backup.tar 4. We access with "psql" to the database and create a implicit cast of the types "lo" and "oid" on both directions. 5. We delete the triggers in the tables with "lo" columns, that calls the function "lo_manage". 6.- We restore the data of the database. pg_restore -Ft -v -a -U myuser -d mydb backup.tar 7.- We create the triggers (again) deleted, in the step 5. I said that this "algorithm" depends on the particular database that we used, because the steps (5 and 7). I think that these steps (5 and 7) could be converted to an database sistematic database independient step. Therefore if someone can improve this solution, write to me and we'll speak. Bye. Juan Miguel Moreno Escar juanmime@ono.com