Skip site navigation (1) Skip section navigation (2)

Re: heap_create with OID?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: heap_create with OID?
Date: 2000-07-04 16:48:22
Message-ID: 27383.962729302@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> The way pg_dump sets the max oid is:

>     CREATE TABLE pgdump_oid (dummy int4);
>     COPY pgdump_oid WITH OIDS FROM stdin;
>     1282249 0
>     \.

> where 1282249 is the max oid you want to set.

> It's pretty crude, but I assume effective.

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.

BTW I'd recommend making pgdump_oid a TEMP table, so that it'll go away
by itself.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: The Hermit HackerDate: 2000-07-04 16:54:15
Subject: Re: [HACKERS] Re: Revised Copyright: is this more palatable?
Previous:From: Jan WieckDate: 2000-07-04 16:46:09
Subject: Re: Statistical aggregates

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group