summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-08-12 01:36:05 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-08-12 01:36:05 +0000
commit721e53785d837d48dc33dd68aa77c42ece7c9afb (patch)
tree59c7bf34cada497f50c61072826d6fa0de080b57 /src/backend/access/heap/heapam.c
parent9e4a2de8448997924e74ace8dfd9ccd05acb2d08 (diff)
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.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index c5851765f25..6e70ab25c10 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -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
{