1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

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.
This commit is contained in:
Tom Lane
2005-04-14 01:38:22 +00:00
parent 2193a856a2
commit 7c13781ee7
72 changed files with 712 additions and 616 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.250 2005/03/29 00:16:55 tgl Exp $
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.251 2005/04/14 01:38:16 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -443,12 +443,17 @@ UpdateIndexRelation(Oid indexoid,
/* ----------------------------------------------------------------
* index_create
*
* indexRelationId is normally InvalidOid to let this routine
* generate an OID for the index. During bootstrap it may be
* nonzero to specify a preselected OID.
*
* Returns OID of the created index.
* ----------------------------------------------------------------
*/
Oid
index_create(Oid heapRelationId,
const char *indexRelationName,
Oid indexRelationId,
IndexInfo *indexInfo,
Oid accessMethodObjectId,
Oid tableSpaceId,
@@ -526,6 +531,7 @@ index_create(Oid heapRelationId,
indexRelation = heap_create(indexRelationName,
namespaceId,
tableSpaceId,
indexRelationId,
indexTupDesc,
RELKIND_INDEX,
shared_relation,
@@ -600,7 +606,7 @@ index_create(Oid heapRelationId,
ObjectAddress myself,
referenced;
myself.classId = RelOid_pg_class;
myself.classId = RelationRelationId;
myself.objectId = indexoid;
myself.objectSubId = 0;
@@ -656,7 +662,7 @@ index_create(Oid heapRelationId,
{
if (indexInfo->ii_KeyAttrNumbers[i] != 0)
{
referenced.classId = RelOid_pg_class;
referenced.classId = RelationRelationId;
referenced.objectId = heapRelationId;
referenced.objectSubId = indexInfo->ii_KeyAttrNumbers[i];
@@ -1693,7 +1699,7 @@ reindex_relation(Oid relid, bool toast_too)
* be created with an entry for its own pg_class row because we do
* setNewRelfilenode() before we do index_build().
*/
is_pg_class = (RelationGetRelid(rel) == RelOid_pg_class);
is_pg_class = (RelationGetRelid(rel) == RelationRelationId);
doneIndexes = NIL;
/* Reindex all the indexes. */