diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-14 01:38:22 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-14 01:38:22 +0000 |
commit | 7c13781ee7a617235f24617e3bd7628cda95df15 (patch) | |
tree | 5815af97251619f856d480997c71ec9aab3b9262 /src/backend/commands/cluster.c | |
parent | 2193a856a229026673cbc56310cd0bddf7b5ea25 (diff) | |
download | postgresql-7c13781ee7a617235f24617e3bd7628cda95df15.tar.gz postgresql-7c13781ee7a617235f24617e3bd7628cda95df15.zip |
First phase of project to use fixed OIDs for all system catalogs and
indexes. Extend the macros in include/catalog/*.h to carry the info
about hand-assigned OIDs, and adjust the genbki script and bootstrap
code to make the relations actually get those OIDs. Remove the small
number of RelOid_pg_foo macros that we had in favor of a complete
set named like the catname.h and indexing.h macros. Next phase will
get rid of internal use of names for looking up catalogs and indexes;
but this completes the changes forcing an initdb, so it looks like a
good place to commit.
Along the way, I made the shared relations (pg_database etc) not be
'bootstrap' relations any more, so as to reduce the number of hardwired
entries and simplify changing those relations in future. I'm not
sure whether they ever really needed to be handled as bootstrap
relations, but it seems to work fine to not do so now.
Diffstat (limited to 'src/backend/commands/cluster.c')
-rw-r--r-- | src/backend/commands/cluster.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e29750c535c..553a8420699 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.134 2005/03/29 00:16:57 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.135 2005/04/14 01:38:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -527,7 +527,7 @@ rebuild_relation(Relation OldHeap, Oid indexOid) CommandCounterIncrement(); /* Destroy new heap with old filenode */ - object.classId = RelOid_pg_class; + object.classId = RelationRelationId; object.objectId = OIDNewHeap; object.objectSubId = 0; @@ -570,6 +570,7 @@ make_new_heap(Oid OIDOldHeap, const char *NewName, Oid NewTableSpace) OIDNewHeap = heap_create_with_catalog(NewName, RelationGetNamespace(OldHeap), NewTableSpace, + InvalidOid, tupdesc, OldHeap->rd_rel->relkind, OldHeap->rd_rel->relisshared, @@ -799,7 +800,7 @@ swap_relation_files(Oid r1, Oid r2) /* Delete old dependencies */ if (relform1->reltoastrelid) { - count = deleteDependencyRecordsFor(RelOid_pg_class, + count = deleteDependencyRecordsFor(RelationRelationId, relform1->reltoastrelid); if (count != 1) elog(ERROR, "expected one dependency record for TOAST table, found %ld", @@ -807,7 +808,7 @@ swap_relation_files(Oid r1, Oid r2) } if (relform2->reltoastrelid) { - count = deleteDependencyRecordsFor(RelOid_pg_class, + count = deleteDependencyRecordsFor(RelationRelationId, relform2->reltoastrelid); if (count != 1) elog(ERROR, "expected one dependency record for TOAST table, found %ld", @@ -815,9 +816,9 @@ swap_relation_files(Oid r1, Oid r2) } /* Register new dependencies */ - baseobject.classId = RelOid_pg_class; + baseobject.classId = RelationRelationId; baseobject.objectSubId = 0; - toastobject.classId = RelOid_pg_class; + toastobject.classId = RelationRelationId; toastobject.objectSubId = 0; if (relform1->reltoastrelid) |