DDL commands don't handle OID wrap

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: DDL commands don't handle OID wrap
Date: 2006-04-17 19:38:30
Message-ID: 20060417193829.GN49405@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Haven't seen this in previous discussions of OID wrap in the archives.
The issue is that DDL statements don't make any attempt to skip past
used ranges of OIDs.

duplicate key violates unique constraint "pg_attrdef_oid_index"
duplicate key violates unique constraint "pg_type_oid_index"
etc...

While part of the solution is obviously not to define tables WITH OIDS,
I would argue that this is still an issue because temporary objects use
OIDs. I'm wondering if anyone has run into this problem and isn't using
tables with OIDs.

Probably the easiest way to fix this would be to trap oid unique
constraint violations on catalog tables and find the next available
number to use (probably want to bump the OID counter up to that at the
same time).

Of course a better method would be to drop OIDs from the catalog tables
completely, but given the amount of work involved in that...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-04-17 19:46:13 Re: DDL commands don't handle OID wrap
Previous Message Guido Barosio 2006-04-17 18:23:00 Re: downward dump compatibility