1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Solve the problem of OID collisions by probing for duplicate OIDs

whenever we generate a new OID.  This prevents occasional duplicate-OID
errors that can otherwise occur once the OID counter has wrapped around.
Duplicate relfilenode values are also checked for when creating new
physical files.  Per my recent proposal.
This commit is contained in:
Tom Lane
2005-08-12 01:36:05 +00:00
parent 9e4a2de844
commit 721e53785d
20 changed files with 416 additions and 268 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.196 2005/08/01 20:31:05 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.197 2005/08/12 01:35:54 tgl Exp $
*
*
* INTERFACE ROUTINES
@ -1069,9 +1069,7 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
* pointers to one another).
*/
if (!OidIsValid(HeapTupleGetOid(tup)))
HeapTupleSetOid(tup, newoid());
else
CheckMaxObjectId(HeapTupleGetOid(tup));
HeapTupleSetOid(tup, GetNewOid(relation));
}
else
{