summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2000-02-27 07:31:00 +0000
committerTom Lane2000-02-27 07:31:00 +0000
commit750549db341438cdaa423ec9f9ac2ae266fa70f5 (patch)
treea435d40af55f939e341d8fbcd3476c67b7a5fe48
parent1e091ad60171d729b1d2f6dba0fa3c7e19da5f3e (diff)
Add Assert() to check for trying to heap_close a relation when the
relcache entry's reference count is zero.
-rw-r--r--src/include/utils/rel.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index c8238008021..dcc9cffcbf4 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: rel.h,v 1.34 2000/01/31 04:35:57 tgl Exp $
+ * $Id: rel.h,v 1.35 2000/02/27 07:31:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -149,7 +149,9 @@ typedef Relation *RelationPtr;
* RelationDecrementReferenceCount
* Decrements relation reference count.
*/
-#define RelationDecrementReferenceCount(relation) ((relation)->rd_refcnt -= 1)
+#define RelationDecrementReferenceCount(relation) \
+ (AssertMacro((relation)->rd_refcnt > 0), \
+ (relation)->rd_refcnt -= 1)
/*
* RelationGetForm