From 721e53785d837d48dc33dd68aa77c42ece7c9afb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 12 Aug 2005 01:36:05 +0000 Subject: 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. --- src/include/catalog/catalog.h | 7 +++++-- src/include/catalog/pg_type.h | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/include/catalog') diff --git a/src/include/catalog/catalog.h b/src/include/catalog/catalog.h index c9da1b35ab..d30bc76359 100644 --- a/src/include/catalog/catalog.h +++ b/src/include/catalog/catalog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catalog.h,v 1.32 2005/05/10 22:27:30 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catalog.h,v 1.33 2005/08/12 01:36:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -31,6 +31,9 @@ extern bool IsToastNamespace(Oid namespaceId); extern bool IsReservedName(const char *name); -extern Oid newoid(void); +extern Oid GetNewOid(Relation relation); +extern Oid GetNewOidWithIndex(Relation relation, Relation indexrel); +extern Oid GetNewRelFileNode(Oid reltablespace, bool relisshared, + Relation pg_class); #endif /* CATALOG_H */ diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 5712e0d692..6e4092fd39 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.164 2005/07/20 16:42:32 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.165 2005/08/12 01:36:04 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -556,7 +556,6 @@ extern Oid TypeShellMake(const char *typeName, Oid typeNamespace); extern Oid TypeCreate(const char *typeName, Oid typeNamespace, - Oid assignedTypeOid, Oid relationOid, char relationKind, int16 internalSize, -- cgit v1.2.1