summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/catcache.c25
-rw-r--r--src/backend/utils/cache/inval.c16
-rw-r--r--src/backend/utils/cache/relcache.c4
3 files changed, 42 insertions, 3 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 616d875dc3f..36a617d8ae0 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.22 1998/02/11 19:12:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.23 1998/02/23 17:43:19 scrappy Exp $
*
* Notes:
* XXX This needs to use exception.h to handle recovery when
@@ -621,6 +621,29 @@ ResetSystemCache()
}
/* --------------------------------
+ * SystemCacheRelationFlushed
+ *
+ * RelationFlushRelation() frees some information referenced in the
+ * cache structures. So we get informed when this is done and arrange
+ * for the next SearchSysCache() call that this information is setup
+ * again.
+ * --------------------------------
+ */
+void
+SystemCacheRelationFlushed(Oid relId)
+{
+ struct catcache *cache;
+
+ for (cache = Caches; PointerIsValid(cache); cache = cache->cc_next)
+ {
+ if (cache->relationId == relId)
+ {
+ cache->relationId = InvalidOid;
+ }
+ }
+}
+
+/* --------------------------------
* InitIndexedSysCache
*
* This allocates and initializes a cache for a system catalog relation.
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index e7b44380ab8..20762257e89 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.9 1997/11/17 16:59:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.10 1998/02/23 17:43:23 scrappy Exp $
*
* Note - this code is real crufty...
*
@@ -512,6 +512,20 @@ RelationInvalidateRelationCache(Relation relation,
(*function) (relationId, objectId);
}
+
+/*
+ * InitLocalInvalidateData
+ *
+ * Setup this before anything could ever get invalid!
+ * Called by InitPostgres();
+ */
+void
+InitLocalInvalidateData()
+{
+ ValidateHacks();
+}
+
+
/*
* DiscardInvalid --
* Causes the invalidated cache state to be discarded.
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 28d9848f7b5..f40d5a3fdbc 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.35 1998/01/31 04:38:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.36 1998/02/23 17:43:25 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -65,6 +65,7 @@
#include "utils/relcache.h"
#include "utils/hsearch.h"
#include "utils/relcache.h"
+#include "utils/catcache.h"
#include "catalog/catname.h"
#include "catalog/catalog.h"
@@ -1344,6 +1345,7 @@ RelationFlushRelation(Relation *relationPtr,
RelationCacheDelete(relation);
FreeTupleDesc(relation->rd_att);
+ SystemCacheRelationFlushed(relation->rd_id);
FreeTriggerDesc(relation);