Re: heap_create with OID?

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: heap_create with OID?
Date: 2000-07-05 05:24:34
Message-ID: 3.0.5.32.20000705152434.02437930@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 12:48 4/07/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>
>Ah, right. IIRC there is a check in COPY to set the OID counter to
>max(current OID counter, user-supplied OID). So you could use this
>technique to install all the BLOBs with the right OIDs, as long as
>you were careful to load them in OID order: just load another row
>into the temp table each time you need to advance the OID counter.
>Kinda klugy, but no backend changes needed.

This might work...the idea would presumably be to load the BLOBs before the
schema, since the OIDs of the BLOBS might be low, and hence conflict could
occur if many tables were defined after the first blob was loaded in the
original DB.

So:

1. createdb
2. load all blobs
3. Do remaining restore steps

The only real problem (and this is in pg_dump as well), is if a table is
dumped with OIDs and the OIDs conflict with automatically generated ones
for the schema. Although this may not be an issue: how unique are OIDs,
anyway? Will corruption of any kind occur in the above case (even with the
old pg_dump)?

I guess I'll throw out lo_create_oi, heap_create_oid & related code. I
guess it taught me a little more about PG internals.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2000-07-05 05:34:41 Re: [HACKERS] Re: Revised Copyright: is this morepalatable?
Previous Message Thomas Lockhart 2000-07-05 05:24:32 Re: Re: [HACKERS] proposed improvements to PostgreSQL license