* CatalogCacheFlushCatalog * * Flush all catcache entries that came from the specified system catalog. * This is needed after VACUUM FULL/CLUSTER on the catalog, since the * tuples very likely now have different TIDs than before. (At one point * we also tried to force re-execution of CatalogCacheInitializeCache for * the cache(s) on that catalog. This is a bad idea since it leads to all
| 717 | * this assumes the tupdesc of a cachable system table will not change...) |
| 718 | */ |
| 719 | void |
| 720 | CatalogCacheFlushCatalog(Oid catId) |
| 721 | { |
| 722 | slist_iter iter; |
| 723 | |
| 724 | CACHE_elog(DEBUG2, "CatalogCacheFlushCatalog called for %u", catId); |
| 725 | |
| 726 | slist_foreach(iter, &CacheHdr->ch_caches) |
| 727 | { |
| 728 | CatCache *cache = slist_container(CatCache, cc_next, iter.cur); |
| 729 | |
| 730 | /* Does this cache store tuples of the target catalog? */ |
| 731 | if (cache->cc_reloid == catId) |
| 732 | { |
| 733 | /* Yes, so flush all its contents */ |
| 734 | ResetCatalogCache(cache); |
| 735 | |
| 736 | /* Tell inval.c to call syscache callbacks for this cache */ |
| 737 | CallSyscacheCallbacks(cache->id, 0); |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | CACHE_elog(DEBUG2, "end of CatalogCacheFlushCatalog call"); |
| 742 | } |
| 743 | |
| 744 | /* |
| 745 | * InitCatCache |
no test coverage detected