Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8b4d4d

Browse files
committed
Fix for index problem that showed up in constraint test.
1 parent8ae24a7 commitc8b4d4d

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

‎src/backend/catalog/index.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.50 1998/08/2022:07:34 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.51 1998/08/2023:01:24 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -1171,31 +1171,33 @@ index_create(char *heapRelationName,
11711171
void
11721172
index_destroy(OidindexId)
11731173
{
1174+
RelationuserindexRelation;
11741175
RelationindexRelation;
1175-
RelationcatalogRelation;
1176+
RelationrelationRelation;
11761177
RelationattributeRelation;
11771178
HeapTupletuple;
11781179
int16attnum;
11791180

11801181
Assert(OidIsValid(indexId));
11811182

1182-
indexRelation=index_open(indexId);
1183+
/* why open it here? bjm 1998/08/20 */
1184+
userindexRelation=index_open(indexId);
11831185

11841186
/* ----------------
11851187
* fix RELATION relation
11861188
* ----------------
11871189
*/
1188-
catalogRelation=heap_openr(RelationRelationName);
1190+
relationRelation=heap_openr(RelationRelationName);
11891191

11901192
tuple=SearchSysCacheTupleCopy(RELOID,
11911193
ObjectIdGetDatum(indexId),
11921194
0,0,0);
11931195

11941196
AssertState(HeapTupleIsValid(tuple));
11951197

1196-
heap_delete(catalogRelation,&tuple->t_ctid);
1198+
heap_delete(relationRelation,&tuple->t_ctid);
11971199
pfree(tuple);
1198-
heap_close(catalogRelation);
1200+
heap_close(relationRelation);
11991201

12001202
/* ----------------
12011203
* fix ATTRIBUTE relation
@@ -1226,23 +1228,24 @@ index_destroy(Oid indexId)
12261228

12271229
if (!HeapTupleIsValid(tuple))
12281230
elog(NOTICE,"IndexRelationDestroy: %s's INDEX tuple missing",
1229-
RelationGetRelationName(indexRelation));
1231+
RelationGetRelationName(userindexRelation));
12301232

1231-
Assert(ItemPointerIsValid(&tuple->t_ctid));
1233+
indexRelation=heap_openr(IndexRelationName);
12321234

12331235
heap_delete(indexRelation,&tuple->t_ctid);
12341236
pfree(tuple);
1237+
heap_close(indexRelation);
12351238

12361239
/*
12371240
* flush cache and physically remove the file
12381241
*/
1239-
ReleaseRelationBuffers(indexRelation);
1242+
ReleaseRelationBuffers(userindexRelation);
12401243

1241-
if (FileNameUnlink(relpath(indexRelation->rd_rel->relname.data))<0)
1244+
if (FileNameUnlink(relpath(userindexRelation->rd_rel->relname.data))<0)
12421245
elog(ERROR,"amdestroyr: unlink: %m");
12431246

1244-
index_close(indexRelation);
1245-
RelationForgetRelation(RelationGetRelid(indexRelation));
1247+
index_close(userindexRelation);
1248+
RelationForgetRelation(RelationGetRelid(userindexRelation));
12461249
}
12471250

12481251
/* ----------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp