Re: Reset oid , starting value=1 -- Max. Number of OID

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Gellert, Andre" <AGellert(at)ElectronicPartner(dot)de>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Reset oid , starting value=1 -- Max. Number of OID
Date: 2003-12-09 19:54:09
Message-ID: 20031209195409.GA16791@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Dec 09, 2003 at 02:52:35PM +0100, Gellert, Andre wrote:
> > The only way to reset oids is to destroy the entire data directory and
> > initdb again. In recent versions you can create tables
> > without oids, thus
> > reducing their usage.
>
> Today we have oid's > 2147483647 , what happens, if we have more than
> allowed ? I remember it was about 4 billions max. oid's, will Postgres
> refresh itself or will it produce errors like "max. records inserted" ???

The OIDs will wrap around, yes. The only real effect is that you run a
really small risk that a CREATE TABLE or some such will fail. Ofcourse, OIDs
will no longer be unique then, but one should never assume they are in the
first place.

> PS: My solution : I moved the applications data to another server ;-) with
> only 1.970.230.087 used OIDs , the application is being fixed at the moment
> (a typecast to int is used on nearly every page).

Are you using it as a primary key?
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arjen van der Meijden 2003-12-09 19:57:27 Re: Making a tree with "millions and millions" of dynamic
Previous Message Peter Eisentraut 2003-12-09 19:46:32 Re: PSQL 7.4 on debian woody