pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problems restoring a DB with oids
2+ messages / 2 participants
[nested] [flat]

* Problems restoring a DB with oids
@ 2004-06-22 14:32  juanmime@ono.com
  0 siblings, 1 reply; 2+ messages in thread

From: juanmime@ono.com @ 2004-06-22 14:32 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have two servers running postgres 7.3 (Server Jupiter), and 7.4.3 (Sever
Saturn), in my office. I have a master database in Jupiter, that contains
a DB with images, OIDs (lo type).

I'm trying to backup the database from Jupiter and restore it in Saturn.

I do this, from Saturn:

pg_dump -Ft -b -U dbuser -h saturn dbsample > db.tar

Then, I create the user and database in Saturno, and perform this:

pg_restore -Ft -v db.tar -d dbsample -U dbuser

But, pg_restore stops, showing this message:

pg_restore: no OID type columns in table photos1
pg_restore: fixing up large-object cross-reference for "inventory"
pg_restore: no OID type columns in table inventory
pg_restore: fixing up large-object cross-reference for "photos2"
pg_restore: fixing large object cross-references for photos2.photo
pg_restore: fixing up large-object cross-reference for "parts"
pg_restore: fixing large object cross-references for parts.qltymemdoc
pg_restore: [archiver (db)] error while updating column "qltymemdoc" of
table "parts": ERROR: large object 609937 does not exist
pg_restore: *** aborted because of error

But this large object, exists. I "untar" the "db.tar" file, and there is
a file called "blob_609937.dat", and it appears in the file "blobs.toc".

Where is the problem ?
How can I do a safety reliable backup in postgres, with databases that contains
"lo" columns ?

I have tried with diferents options (dumping and restoring), but always
appear the same problem. This have seen this problem in databases using
large objects (lo type), since version 7.3.

It is a critical situation, because I have seen those problems in a production
system, .... what will happend if the database would crack ?

Thanks.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Problems restoring a DB with oids
@ 2004-06-22 17:15  Tom Lane <tgl@sss.pgh.pa.us>
  parent: juanmime@ono.com
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-06-22 17:15 UTC (permalink / raw)
  To: juanmime@ono.com; +Cc: pgsql-admin

juanmime@ono.com writes:
> I do this, from Saturn:
> pg_dump -Ft -b -U dbuser -h saturn dbsample > db.tar
> Then, I create the user and database in Saturno, and perform this:
> pg_restore -Ft -v db.tar -d dbsample -U dbuser
> But, pg_restore stops, showing this message:

> pg_restore: fixing large object cross-references for parts.qltymemdoc
> pg_restore: [archiver (db)] error while updating column "qltymemdoc" of
> table "parts": ERROR: large object 609937 does not exist
> pg_restore: *** aborted because of error

I think what is happening is that dbuser is not a superuser (correct?)
and therefore is unable to disable triggers during the restore.  But
you have to disable the lo_manage trigger to avoid errors, because
lo_manage will think it has to clean up the blob references in the
existing data.

In short: if you are using the LO type then blob restores have to be
done as superuser.  I suppose this oughta be documented someplace...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-06-22 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-22 14:32 Problems restoring a DB with oids juanmime@ono.com
2004-06-22 17:15 ` Tom Lane <tgl@sss.pgh.pa.us>

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