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

Started by Gellert, Andreover 22 years ago2 messagesgeneral
Jump to latest
#1Gellert, Andre
AGellert@ElectronicPartner.de

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" ???

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).

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Gellert, Andre (#1)

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@svana.org> http://svana.org/kleptog/

Show quoted text

(... 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