heap_drop() should flush the relcache entry for the

relation being dropped.
This commit is contained in:
Tom Lane 2000-05-25 21:25:32 +00:00
parent 69cc16f47e
commit 445f1acf7a

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.127 2000/05/20 23:11:29 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.128 2000/05/25 21:25:32 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
@ -1578,12 +1578,15 @@ heap_drop_with_catalog(const char *relname)
void void
heap_drop(Relation rel) heap_drop(Relation rel)
{ {
Oid rid = RelationGetRelid(rel);
ReleaseRelationBuffers(rel); ReleaseRelationBuffers(rel);
if (!(rel->rd_isnoname) || !(rel->rd_unlinked)) if (!(rel->rd_isnoname) || !(rel->rd_unlinked))
smgrunlink(DEFAULT_SMGR, rel); smgrunlink(DEFAULT_SMGR, rel);
rel->rd_unlinked = TRUE; rel->rd_unlinked = TRUE;
heap_close(rel, NoLock); heap_close(rel, NoLock);
RemoveFromNoNameRelList(rel); RemoveFromNoNameRelList(rel);
RelationForgetRelation(rid);
} }