Re: BLOBs, pg_dump & pg_restore - Mailing list pgsql-general

From Tom Lane
Subject Re: BLOBs, pg_dump & pg_restore
Date
Msg-id 19421.1065068587@sss.pgh.pa.us
Whole thread Raw
In response to Re: BLOBs, pg_dump & pg_restore  (Howard Lowndes <lannet@lannet.com.au>)
Responses Re: BLOBs, pg_dump & pg_restore
List pgsql-general
Howard Lowndes <lannet@lannet.com.au> writes:
> On Wed, 1 Oct 2003, Tom Lane wrote:
>> No, because pg_restore has logic to adjust the references to match the
>> new BLOB OIDs.  If you have a test case where this fails to work, let's
>> see it ...

> No, I don't have any example, it is an enquiry.  What I am reading into
> the above however is that the loid column in my table should have a
> CONSTRAINT REFERENCES clause to whereever in the system large objects
> table.  Correct?

No.  No doubt if Postgres had had foreign keys when the large-object stuff
was invented, it would have required such a constraint for LO
references, but it didn't and it doesn't.  The pg_restore code simply
goes through all "oid" columns (and all "lo" columns if you've installed
the contrib/lo datatype) and looks for matches to LO OIDs that existed
in the dumped database.  When it finds a match, it replaces that value
with the new BLOB's OID.  Simple, effective, crufty ...

            regards, tom lane

pgsql-general by date:

Previous
From: Howard Lowndes
Date:
Subject: Re: BLOBs, pg_dump & pg_restore
Next
From: Howard Lowndes
Date:
Subject: Re: BLOBs, pg_dump & pg_restore