oids and pg_class_oid_index constraint violations - Mailing list pgsql-general

From Aaron Harsh
Subject oids and pg_class_oid_index constraint violations
Date
Msg-id s2f0ba35.043@rtk_mail_1.rentrak.com
Whole thread Raw
Responses Re: oids and pg_class_oid_index constraint violations  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
We've just recently started seeing sporadic constraint violations on system tables.  For example:

  duplicate key violates unique constraint "pg_class_oid_index" [for Statement "CREATE TEMPORARY TABLE...

and

  duplicate key violates unique constraint "pg_toast_4292803267_index" [for Statement "INSERT INTO...

and the occasional

  unexpected chunk number 0 (expected 1) for toast value

I suspect that the problem is due to oid reuse, but I'd like to get a second opinion.  We've just recently grown to a
billiontuples in our database (with all our tables built with oids), and the volume of activity makes me think it's
likelythat the majority of records have been updated three or four times. 

Our current plan for dealing with the problem is to 'SET WITHOUT OIDS' on our tables, then dump & restore the database.

Does it seem reasonable that oid reuse could cause the constraint violations?  Does it seem likely that this would fix
theproblem?  Is there an easier way to solve the problem? 

Thanks in advance

--
Aaron Harsh
ajh@rentrak.com
503-284-7581 x347


pgsql-general by date:

Previous
From: Peter Wilson
Date:
Subject: Re: feeding big script to psql
Next
From: "Magnus Hagander"
Date:
Subject: Re: Windows file path for copy