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

Commit9c6cdb4

Browse files
committed
heap_destroy() now calls RelationForgetRelation() to really flush
the relation from the relcache.
1 parentded4650 commit9c6cdb4

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎src/backend/catalog/heap.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.13 1997/04/02 03:41:16 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.14 1997/06/04 08:59:22 vadim Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
*heap_creatr()- Create an uncataloged heap relation
@@ -1229,17 +1229,19 @@ void
12291229
heap_destroy(char*relname)
12301230
{
12311231
Relationrdesc;
1232+
Oidrid;
12321233

12331234
/* ----------------
12341235
*first open the relation. if the relation does exist,
12351236
* heap_openr() returns NULL.
12361237
* ----------------
12371238
*/
12381239
rdesc=heap_openr(relname);
1239-
if (rdesc==NULL)
1240-
elog(WARN,"Relation %s Does Not Exist!",relname);
1240+
if (rdesc==NULL)
1241+
elog(WARN,"Relation %s Does Not Exist!",relname);
12411242

12421243
RelationSetLockForWrite(rdesc);
1244+
rid=rdesc->rd_id;
12431245

12441246
/* ----------------
12451247
*prevent deletion of system relations
@@ -1268,7 +1270,7 @@ heap_destroy(char *relname)
12681270
* ----------------
12691271
*/
12701272
if (rdesc->rd_rules!=NULL) {
1271-
RelationRemoveRules(rdesc->rd_id);
1273+
RelationRemoveRules(rid);
12721274
}
12731275

12741276
/* ----------------
@@ -1300,8 +1302,9 @@ heap_destroy(char *relname)
13001302
/* ----------------
13011303
*flush the relation from the relcache
13021304
* ----------------
1303-
*/
1305+
* Does nothing!!! Flushing moved below.- vadim 06/04/97
13041306
RelationIdInvalidateRelationCacheByRelationId(rdesc->rd_id);
1307+
*/
13051308

13061309
/* ----------------
13071310
*unlink the relation and finish up.
@@ -1316,6 +1319,9 @@ heap_destroy(char *relname)
13161319
RelationUnsetLockForWrite(rdesc);
13171320

13181321
heap_close(rdesc);
1322+
1323+
/* ok - flush the relation from the relcache */
1324+
RelationForgetRelation (rid);
13191325
}
13201326

13211327
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp