|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.149 2010/02/07 20:48:10 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.150 2010/02/08 05:53:55 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -672,91 +672,6 @@ ResetCatalogCaches(void)
|
672 | 672 | CACHE1_elog(DEBUG2, "end of ResetCatalogCaches call");
|
673 | 673 | }
|
674 | 674 |
|
675 |
| -/* |
676 |
| - * CatalogCacheFlushRelation |
677 |
| - * |
678 |
| - * This is called by RelationFlushRelation() to clear out cached information |
679 |
| - * about a relation being dropped. (This could be a DROP TABLE command, |
680 |
| - * or a temp table being dropped at end of transaction, or a table created |
681 |
| - * during the current transaction that is being dropped because of abort.) |
682 |
| - * Remove all cache entries relevant to the specified relation OID. |
683 |
| - */ |
684 |
| -void |
685 |
| -CatalogCacheFlushRelation(Oid relId) |
686 |
| -{ |
687 |
| - CatCache *cache; |
688 |
| - |
689 |
| - CACHE2_elog(DEBUG2, "CatalogCacheFlushRelation called for %u", relId); |
690 |
| - |
691 |
| - for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next) |
692 |
| - { |
693 |
| - int i; |
694 |
| - |
695 |
| - /* We can ignore uninitialized caches, since they must be empty */ |
696 |
| - if (cache->cc_tupdesc == NULL) |
697 |
| - continue; |
698 |
| - |
699 |
| - /* Does this cache store tuples associated with relations at all? */ |
700 |
| - if (cache->cc_reloidattr == 0) |
701 |
| - continue; /* nope, leave it alone */ |
702 |
| - |
703 |
| - /* Yes, scan the tuples and remove those related to relId */ |
704 |
| - for (i = 0; i < cache->cc_nbuckets; i++) |
705 |
| - { |
706 |
| - Dlelem *elt, |
707 |
| - *nextelt; |
708 |
| - |
709 |
| - for (elt = DLGetHead(&cache->cc_bucket[i]); elt; elt = nextelt) |
710 |
| - { |
711 |
| - CatCTup *ct = (CatCTup *) DLE_VAL(elt); |
712 |
| - Oid tupRelid; |
713 |
| - |
714 |
| - nextelt = DLGetSucc(elt); |
715 |
| - |
716 |
| - /* |
717 |
| - * Negative entries are never considered related to a rel, |
718 |
| - * even if the rel is part of their lookup key. |
719 |
| - */ |
720 |
| - if (ct->negative) |
721 |
| - continue; |
722 |
| - |
723 |
| - if (cache->cc_reloidattr == ObjectIdAttributeNumber) |
724 |
| - tupRelid = HeapTupleGetOid(&ct->tuple); |
725 |
| - else |
726 |
| - { |
727 |
| - bool isNull; |
728 |
| - |
729 |
| - tupRelid = |
730 |
| - DatumGetObjectId(fastgetattr(&ct->tuple, |
731 |
| - cache->cc_reloidattr, |
732 |
| - cache->cc_tupdesc, |
733 |
| - &isNull)); |
734 |
| - Assert(!isNull); |
735 |
| - } |
736 |
| - |
737 |
| - if (tupRelid == relId) |
738 |
| - { |
739 |
| - if (ct->refcount > 0 || |
740 |
| - (ct->c_list && ct->c_list->refcount > 0)) |
741 |
| - { |
742 |
| - ct->dead = true; |
743 |
| - /* parent list must be considered dead too */ |
744 |
| - if (ct->c_list) |
745 |
| - ct->c_list->dead = true; |
746 |
| - } |
747 |
| - else |
748 |
| - CatCacheRemoveCTup(cache, ct); |
749 |
| -#ifdef CATCACHE_STATS |
750 |
| - cache->cc_invals++; |
751 |
| -#endif |
752 |
| - } |
753 |
| - } |
754 |
| - } |
755 |
| - } |
756 |
| - |
757 |
| - CACHE1_elog(DEBUG2, "end of CatalogCacheFlushRelation call"); |
758 |
| -} |
759 |
| - |
760 | 675 | /*
|
761 | 676 | * CatalogCacheFlushCatalog
|
762 | 677 | *
|
@@ -820,7 +735,6 @@ CatCache *
|
820 | 735 | InitCatCache(int id,
|
821 | 736 | Oid reloid,
|
822 | 737 | Oid indexoid,
|
823 |
| - int reloidattr, |
824 | 738 | int nkeys,
|
825 | 739 | const int *key,
|
826 | 740 | int nbuckets)
|
@@ -884,7 +798,6 @@ InitCatCache(int id,
|
884 | 798 | cp->cc_indexoid = indexoid;
|
885 | 799 | cp->cc_relisshared = false; /* temporary */
|
886 | 800 | cp->cc_tupdesc = (TupleDesc) NULL;
|
887 |
| - cp->cc_reloidattr = reloidattr; |
888 | 801 | cp->cc_ntup = 0;
|
889 | 802 | cp->cc_nbuckets = nbuckets;
|
890 | 803 | cp->cc_nkeys = nkeys;
|
|
0 commit comments