diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index db90ad619b4..03a037b978f 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1987,9 +1987,6 @@ CommitTransaction(void) RESOURCE_RELEASE_AFTER_LOCKS, true, true); - /* Check we've released all catcache entries */ - AtEOXact_CatCache(true); - AtCommit_Notify(); AtEOXact_GUC(true, 1); AtEOXact_SPI(true); @@ -2252,9 +2249,6 @@ PrepareTransaction(void) */ PostPrepare_Twophase(); - /* Check we've released all catcache entries */ - AtEOXact_CatCache(true); - /* PREPARE acts the same as COMMIT as far as GUC is concerned */ AtEOXact_GUC(true, 1); AtEOXact_SPI(true); @@ -2402,7 +2396,6 @@ AbortTransaction(void) ResourceOwnerRelease(TopTransactionResourceOwner, RESOURCE_RELEASE_AFTER_LOCKS, false, true); - AtEOXact_CatCache(false); AtEOXact_GUC(false, 1); AtEOXact_SPI(false); diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 6a27778b978..e4a52ce2228 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -542,57 +542,6 @@ CreateCacheMemoryContext(void) } -/* - * AtEOXact_CatCache - * - * Clean up catcaches at end of main transaction (either commit or abort) - * - * As of PostgreSQL 8.1, catcache pins should get released by the - * ResourceOwner mechanism. This routine is just a debugging - * cross-check that no pins remain. - */ -void -AtEOXact_CatCache(bool isCommit) -{ -#ifdef USE_ASSERT_CHECKING - if (assert_enabled) - { - CatCache *ccp; - - for (ccp = CacheHdr->ch_caches; ccp; ccp = ccp->cc_next) - { - Dlelem *elt; - int i; - - /* Check CatCLists */ - for (elt = DLGetHead(&ccp->cc_lists); elt; elt = DLGetSucc(elt)) - { - CatCList *cl = (CatCList *) DLE_VAL(elt); - - Assert(cl->cl_magic == CL_MAGIC); - Assert(cl->refcount == 0); - Assert(!cl->dead); - } - - /* Check individual tuples */ - for (i = 0; i < ccp->cc_nbuckets; i++) - { - for (elt = DLGetHead(&ccp->cc_bucket[i]); - elt; - elt = DLGetSucc(elt)) - { - CatCTup *ct = (CatCTup *) DLE_VAL(elt); - - Assert(ct->ct_magic == CT_MAGIC); - Assert(ct->refcount == 0); - Assert(!ct->dead); - } - } - } - } -#endif -} - /* * ResetCatalogCache * diff --git a/src/include/utils/catcache.h b/src/include/utils/catcache.h index f932f1570df..1bdbeaf6b07 100644 --- a/src/include/utils/catcache.h +++ b/src/include/utils/catcache.h @@ -162,7 +162,6 @@ typedef struct catcacheheader extern PGDLLIMPORT MemoryContext CacheMemoryContext; extern void CreateCacheMemoryContext(void); -extern void AtEOXact_CatCache(bool isCommit); extern CatCache *InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key,