mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Commit to make clearer distinction for temp names and real names.
Thanks to Tom Lane for ideas.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.94 1999/11/04 08:00:56 inoue Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.95 1999/11/16 04:13:55 momjian Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -120,7 +120,7 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName, bool istemp)
|
||||
indoid = RelnameFindRelid(indexRelationName);
|
||||
|
||||
if ((!istemp && OidIsValid(indoid)) ||
|
||||
(istemp && get_temp_rel_by_name(indexRelationName) != NULL))
|
||||
(istemp && get_temp_rel_by_username(indexRelationName) != NULL))
|
||||
elog(ERROR, "Cannot create index: '%s' already exists",
|
||||
indexRelationName);
|
||||
|
||||
@@ -948,7 +948,7 @@ index_create(char *heapRelationName,
|
||||
Oid heapoid;
|
||||
Oid indexoid;
|
||||
PredInfo *predInfo;
|
||||
bool istemp = (get_temp_rel_by_name(heapRelationName) != NULL);
|
||||
bool istemp = (get_temp_rel_by_username(heapRelationName) != NULL);
|
||||
char *temp_relname = NULL;
|
||||
|
||||
/* ----------------
|
||||
@@ -1182,9 +1182,6 @@ index_destroy(Oid indexId)
|
||||
}
|
||||
heap_close(attributeRelation, RowExclusiveLock);
|
||||
|
||||
/* does something only if it is a temp index */
|
||||
remove_temp_relation(indexId);
|
||||
|
||||
/* ----------------
|
||||
* fix INDEX relation
|
||||
* ----------------
|
||||
@@ -1211,6 +1208,9 @@ index_destroy(Oid indexId)
|
||||
index_close(userindexRelation);
|
||||
|
||||
RelationForgetRelation(indexId);
|
||||
|
||||
/* does something only if it is a temp index */
|
||||
remove_temp_relation(indexId);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user