Re: Can I adjust the oid counter for testing?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can I adjust the oid counter for testing?
Date: 2002-06-17 16:54:49
Message-ID: 200206171654.g5HGsnW14214@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
> > I need to do some testing of pgAdmin on a database with very large oids
> > (> 4,000,000,000). Is there anyway I can wind the oid counter forward
> > without having to do a few billion inserts?
> > I'm on a test system so I can initdb if required.
>
> A clean solution would be to extend pg_resetxlog to have a switch to set
> nextOid, parallel to its switch to tweak nextXid. (I had thought we had
> this already, actually, but I'm not seeing it in current sources.)

Yes, I thought we had that too, but I don't see it.

Actually, you can just use COPY WITH OIDS and insert a large oid. That
will set the counter. That's how pg_dump does it:

CREATE TEMPORARY TABLE pgdump_oid (dummy integer);
COPY pgdump_oid WITH OIDS FROM stdin;
143655 0
\.

This method will only _increase_ the oid.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 2002-06-17 16:55:17 Re: WITH handling in CREATE USER, etc
Previous Message Bruce Momjian 2002-06-17 16:46:53 Re: WITH handling in CREATE USER, etc