From a28375140c6d8129f4eae89e03bf955d0720958b Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon, 29 Jul 2002 20:45:44 +0000
Subject: [PATCH] Fix minor coding error: don't ReleaseSysCache until after
 last use of cache entry.

---
 src/backend/commands/functioncmds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 29c3e550e74..d957af2d407 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.13 2002/07/24 19:11:09 petere Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.14 2002/07/29 20:45:44 tgl Exp $
  *
  * DESCRIPTION
  *	  These routines take the parse tree and pick out the
@@ -764,8 +764,6 @@ DropCast(DropCastStmt *stmt)
 			elog(ERROR, "permission denied");
 	}
 
-	ReleaseSysCache(tuple);
-
 	/*
 	 * Do the deletion
 	 */
@@ -773,6 +771,8 @@ DropCast(DropCastStmt *stmt)
 	object.objectId = HeapTupleGetOid(tuple);
 	object.objectSubId = 0;
 
+	ReleaseSysCache(tuple);
+
 	performDeletion(&object, stmt->behavior);
 }
 
-- 
GitLab