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 2BCEAD1B502 for ; Tue, 16 Sep 2003 22:12:19 +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 56453-02 for ; Tue, 16 Sep 2003 19:11:50 -0300 (ADT) Received: from dukas.upc.es (dukas.upc.es [147.83.2.62]) by svr1.postgresql.org (Postfix) with ESMTP id 1B87CD1B512 for ; Tue, 16 Sep 2003 19:11:47 -0300 (ADT) Received: from ackerman.upc.es (ackerman.upcnetadm.upcnet.es [147.83.2.243]) by dukas.upc.es (8.12.1/8.12.1) with ESMTP id h8GMBlsB027339; Wed, 17 Sep 2003 00:11:48 +0200 (MET DST) Received: from est.fib.upc.es ([80.59.140.235]) by ackerman.upc.es (Lotus Domino Release 5.0.9) with ESMTP id 2003091700114628:7054 ; Wed, 17 Sep 2003 00:11:46 +0200 Message-ID: <3F678D3A.7090304@est.fib.upc.es> Date: Wed, 17 Sep 2003 00:22:50 +0200 From: =?ISO-8859-1?Q?Gustavo_P=E9rez?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: After many tests to dump X-MIMETrack: Itemize by SMTP Server on Ackerman/UPC(Release 5.0.9 |November 16, 2001) at 17/09/2003 00:11:46, Serialize by Router on Ackerman/UPC(Release 5.0.9 |November 16, 2001) at 17/09/2003 00:11:48 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/289 X-Sequence-Number: 10377 Hi, I think It has been answered before (talking about a post in 4/21).=20 Checking the forums for many times didn't help, so I have no other=20 choice but to ask you : I'm trying to dump a DB with BLOB's on it. I'm using a Slackware 9.0=20 with postgreSQL 7.3.3. I have a single relation called 'files' like this : CREATE TABLE FILES (I INTEGER PRIMARY KEY, BIN OID); Inserting a tuple : INSERT INTO FILES VALUES (1,lo_import('/tmp/test')); worked fine, returning the oid. I retreived the file succesfully : SELECT lo_export (bin,'/tmp/value') FROM FILES WHERE I=3D1; as you should expect. So after comiting everything, I left the psql=20 client, and being in the bash I typed : ./pg_dump -Fc -obvf pgsql.dump -U pgsql pgsql which should dump the database with blob's and oid's to a file=20 called pgsql.dump in custom format (say that I triied in tar format too). I seemed to work fine so I typed : =20=20=20=20=20=20=20=20 ./creatdb -U pgsql -E SQL_ASCII -T template0 test Which should create a new database using template0 with enconding=20 in SQL_ASCII (which is the default, isn't it ?). After that : bin/pg_restore -Fc -v -d prova -o -U pgsql pgsql.dump Which should recreate the database. I checked for the BLOB's in=20 the new database by using the comand : \dl (or \lo_list) =20 showed me just one BLOB with a DIFFERENT OID. I know this is what=20 should be. But the problem is that the OID in the new relation in the new database is still the old value=20 !!!! (reading I found that pg_restore should look for the oid's in the relations, resolving the old values and=20 updating with new oid values, seems not to work). Like this (keep in mind there's only one tuple in the relation=20 FILE) : VALUE in OLD DATABASE=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 VALUE in NEW DATABASE \dl 58841=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 58945 select bin from FILES 58841=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 58841 So the OID had not been rewritten. Is there any explanation to=20 this ? May you help me please with this very problem ? In the meanwhile=20 I'll be searching more information again. Thanks in advance for your help, =20=20=20=20=20=20 Gustavo P=E9rez