diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1997-06-04 08:59:22 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1997-06-04 08:59:22 +0000 |
commit | 9c6cdb4d7bc85ba60a7303e401c94a96276104e1 (patch) | |
tree | f2a780870723cfbc22ab1de83e03b07ea42d0d4a | |
parent | ded465064278a938e3360dc1ca2259dd0fc1a297 (diff) | |
download | postgresql-9c6cdb4d7bc85ba60a7303e401c94a96276104e1.tar.gz postgresql-9c6cdb4d7bc85ba60a7303e401c94a96276104e1.zip |
heap_destroy() now calls RelationForgetRelation() to really flush
the relation from the relcache.
-rw-r--r-- | src/backend/catalog/heap.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 283f59b664d..81d2e1127cf 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.13 1997/04/02 03:41:16 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.14 1997/06/04 08:59:22 vadim Exp $ * * INTERFACE ROUTINES * heap_creatr() - Create an uncataloged heap relation @@ -1229,6 +1229,7 @@ void heap_destroy(char *relname) { Relation rdesc; + Oid rid; /* ---------------- * first open the relation. if the relation does exist, @@ -1236,10 +1237,11 @@ heap_destroy(char *relname) * ---------------- */ rdesc = heap_openr(relname); - if (rdesc == NULL) - elog(WARN,"Relation %s Does Not Exist!", relname); + if ( rdesc == NULL ) + elog (WARN, "Relation %s Does Not Exist!", relname); RelationSetLockForWrite(rdesc); + rid = rdesc->rd_id; /* ---------------- * prevent deletion of system relations @@ -1268,7 +1270,7 @@ heap_destroy(char *relname) * ---------------- */ if (rdesc->rd_rules != NULL) { - RelationRemoveRules(rdesc->rd_id); + RelationRemoveRules(rid); } /* ---------------- @@ -1300,8 +1302,9 @@ heap_destroy(char *relname) /* ---------------- * flush the relation from the relcache * ---------------- - */ + * Does nothing!!! Flushing moved below. - vadim 06/04/97 RelationIdInvalidateRelationCacheByRelationId(rdesc->rd_id); + */ /* ---------------- * unlink the relation and finish up. @@ -1316,6 +1319,9 @@ heap_destroy(char *relname) RelationUnsetLockForWrite(rdesc); heap_close(rdesc); + + /* ok - flush the relation from the relcache */ + RelationForgetRelation (rid); } /* |