00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "postgres.h"
00022
00023 #include "access/htup_details.h"
00024 #include "access/sysattr.h"
00025 #include "catalog/indexing.h"
00026 #include "catalog/pg_aggregate.h"
00027 #include "catalog/pg_amop.h"
00028 #include "catalog/pg_amproc.h"
00029 #include "catalog/pg_auth_members.h"
00030 #include "catalog/pg_authid.h"
00031 #include "catalog/pg_cast.h"
00032 #include "catalog/pg_collation.h"
00033 #include "catalog/pg_constraint.h"
00034 #include "catalog/pg_conversion.h"
00035 #include "catalog/pg_database.h"
00036 #include "catalog/pg_default_acl.h"
00037 #include "catalog/pg_enum.h"
00038 #include "catalog/pg_event_trigger.h"
00039 #include "catalog/pg_foreign_data_wrapper.h"
00040 #include "catalog/pg_foreign_server.h"
00041 #include "catalog/pg_foreign_table.h"
00042 #include "catalog/pg_language.h"
00043 #include "catalog/pg_namespace.h"
00044 #include "catalog/pg_opclass.h"
00045 #include "catalog/pg_operator.h"
00046 #include "catalog/pg_opfamily.h"
00047 #include "catalog/pg_proc.h"
00048 #include "catalog/pg_range.h"
00049 #include "catalog/pg_rewrite.h"
00050 #include "catalog/pg_statistic.h"
00051 #include "catalog/pg_tablespace.h"
00052 #include "catalog/pg_ts_config.h"
00053 #include "catalog/pg_ts_config_map.h"
00054 #include "catalog/pg_ts_dict.h"
00055 #include "catalog/pg_ts_parser.h"
00056 #include "catalog/pg_ts_template.h"
00057 #include "catalog/pg_type.h"
00058 #include "catalog/pg_user_mapping.h"
00059 #include "utils/rel.h"
00060 #include "utils/catcache.h"
00061 #include "utils/syscache.h"
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 struct cachedesc
00100 {
00101 Oid reloid;
00102 Oid indoid;
00103 int nkeys;
00104 int key[4];
00105 int nbuckets;
00106 };
00107
00108 static const struct cachedesc cacheinfo[] = {
00109 {AggregateRelationId,
00110 AggregateFnoidIndexId,
00111 1,
00112 {
00113 Anum_pg_aggregate_aggfnoid,
00114 0,
00115 0,
00116 0
00117 },
00118 32
00119 },
00120 {AccessMethodRelationId,
00121 AmNameIndexId,
00122 1,
00123 {
00124 Anum_pg_am_amname,
00125 0,
00126 0,
00127 0
00128 },
00129 4
00130 },
00131 {AccessMethodRelationId,
00132 AmOidIndexId,
00133 1,
00134 {
00135 ObjectIdAttributeNumber,
00136 0,
00137 0,
00138 0
00139 },
00140 4
00141 },
00142 {AccessMethodOperatorRelationId,
00143 AccessMethodOperatorIndexId,
00144 3,
00145 {
00146 Anum_pg_amop_amopopr,
00147 Anum_pg_amop_amoppurpose,
00148 Anum_pg_amop_amopfamily,
00149 0
00150 },
00151 64
00152 },
00153 {AccessMethodOperatorRelationId,
00154 AccessMethodStrategyIndexId,
00155 4,
00156 {
00157 Anum_pg_amop_amopfamily,
00158 Anum_pg_amop_amoplefttype,
00159 Anum_pg_amop_amoprighttype,
00160 Anum_pg_amop_amopstrategy
00161 },
00162 64
00163 },
00164 {AccessMethodProcedureRelationId,
00165 AccessMethodProcedureIndexId,
00166 4,
00167 {
00168 Anum_pg_amproc_amprocfamily,
00169 Anum_pg_amproc_amproclefttype,
00170 Anum_pg_amproc_amprocrighttype,
00171 Anum_pg_amproc_amprocnum
00172 },
00173 64
00174 },
00175 {AttributeRelationId,
00176 AttributeRelidNameIndexId,
00177 2,
00178 {
00179 Anum_pg_attribute_attrelid,
00180 Anum_pg_attribute_attname,
00181 0,
00182 0
00183 },
00184 2048
00185 },
00186 {AttributeRelationId,
00187 AttributeRelidNumIndexId,
00188 2,
00189 {
00190 Anum_pg_attribute_attrelid,
00191 Anum_pg_attribute_attnum,
00192 0,
00193 0
00194 },
00195 2048
00196 },
00197 {AuthMemRelationId,
00198 AuthMemMemRoleIndexId,
00199 2,
00200 {
00201 Anum_pg_auth_members_member,
00202 Anum_pg_auth_members_roleid,
00203 0,
00204 0
00205 },
00206 128
00207 },
00208 {AuthMemRelationId,
00209 AuthMemRoleMemIndexId,
00210 2,
00211 {
00212 Anum_pg_auth_members_roleid,
00213 Anum_pg_auth_members_member,
00214 0,
00215 0
00216 },
00217 128
00218 },
00219 {AuthIdRelationId,
00220 AuthIdRolnameIndexId,
00221 1,
00222 {
00223 Anum_pg_authid_rolname,
00224 0,
00225 0,
00226 0
00227 },
00228 128
00229 },
00230 {AuthIdRelationId,
00231 AuthIdOidIndexId,
00232 1,
00233 {
00234 ObjectIdAttributeNumber,
00235 0,
00236 0,
00237 0
00238 },
00239 128
00240 },
00241 {
00242 CastRelationId,
00243 CastSourceTargetIndexId,
00244 2,
00245 {
00246 Anum_pg_cast_castsource,
00247 Anum_pg_cast_casttarget,
00248 0,
00249 0
00250 },
00251 256
00252 },
00253 {OperatorClassRelationId,
00254 OpclassAmNameNspIndexId,
00255 3,
00256 {
00257 Anum_pg_opclass_opcmethod,
00258 Anum_pg_opclass_opcname,
00259 Anum_pg_opclass_opcnamespace,
00260 0
00261 },
00262 64
00263 },
00264 {OperatorClassRelationId,
00265 OpclassOidIndexId,
00266 1,
00267 {
00268 ObjectIdAttributeNumber,
00269 0,
00270 0,
00271 0
00272 },
00273 64
00274 },
00275 {CollationRelationId,
00276 CollationNameEncNspIndexId,
00277 3,
00278 {
00279 Anum_pg_collation_collname,
00280 Anum_pg_collation_collencoding,
00281 Anum_pg_collation_collnamespace,
00282 0
00283 },
00284 64
00285 },
00286 {CollationRelationId,
00287 CollationOidIndexId,
00288 1,
00289 {
00290 ObjectIdAttributeNumber,
00291 0,
00292 0,
00293 0
00294 },
00295 64
00296 },
00297 {ConversionRelationId,
00298 ConversionDefaultIndexId,
00299 4,
00300 {
00301 Anum_pg_conversion_connamespace,
00302 Anum_pg_conversion_conforencoding,
00303 Anum_pg_conversion_contoencoding,
00304 ObjectIdAttributeNumber,
00305 },
00306 128
00307 },
00308 {ConversionRelationId,
00309 ConversionNameNspIndexId,
00310 2,
00311 {
00312 Anum_pg_conversion_conname,
00313 Anum_pg_conversion_connamespace,
00314 0,
00315 0
00316 },
00317 128
00318 },
00319 {ConstraintRelationId,
00320 ConstraintOidIndexId,
00321 1,
00322 {
00323 ObjectIdAttributeNumber,
00324 0,
00325 0,
00326 0
00327 },
00328 1024
00329 },
00330 {ConversionRelationId,
00331 ConversionOidIndexId,
00332 1,
00333 {
00334 ObjectIdAttributeNumber,
00335 0,
00336 0,
00337 0
00338 },
00339 128
00340 },
00341 {DatabaseRelationId,
00342 DatabaseOidIndexId,
00343 1,
00344 {
00345 ObjectIdAttributeNumber,
00346 0,
00347 0,
00348 0
00349 },
00350 4
00351 },
00352 {DefaultAclRelationId,
00353 DefaultAclRoleNspObjIndexId,
00354 3,
00355 {
00356 Anum_pg_default_acl_defaclrole,
00357 Anum_pg_default_acl_defaclnamespace,
00358 Anum_pg_default_acl_defaclobjtype,
00359 0
00360 },
00361 256
00362 },
00363 {EnumRelationId,
00364 EnumOidIndexId,
00365 1,
00366 {
00367 ObjectIdAttributeNumber,
00368 0,
00369 0,
00370 0
00371 },
00372 256
00373 },
00374 {EnumRelationId,
00375 EnumTypIdLabelIndexId,
00376 2,
00377 {
00378 Anum_pg_enum_enumtypid,
00379 Anum_pg_enum_enumlabel,
00380 0,
00381 0
00382 },
00383 256
00384 },
00385 {EventTriggerRelationId,
00386 EventTriggerNameIndexId,
00387 1,
00388 {
00389 Anum_pg_event_trigger_evtname,
00390 0,
00391 0,
00392 0
00393 },
00394 8
00395 },
00396 {EventTriggerRelationId,
00397 EventTriggerOidIndexId,
00398 1,
00399 {
00400 ObjectIdAttributeNumber,
00401 0,
00402 0,
00403 0
00404 },
00405 8
00406 },
00407 {ForeignDataWrapperRelationId,
00408 ForeignDataWrapperNameIndexId,
00409 1,
00410 {
00411 Anum_pg_foreign_data_wrapper_fdwname,
00412 0,
00413 0,
00414 0
00415 },
00416 8
00417 },
00418 {ForeignDataWrapperRelationId,
00419 ForeignDataWrapperOidIndexId,
00420 1,
00421 {
00422 ObjectIdAttributeNumber,
00423 0,
00424 0,
00425 0
00426 },
00427 8
00428 },
00429 {ForeignServerRelationId,
00430 ForeignServerNameIndexId,
00431 1,
00432 {
00433 Anum_pg_foreign_server_srvname,
00434 0,
00435 0,
00436 0
00437 },
00438 32
00439 },
00440 {ForeignServerRelationId,
00441 ForeignServerOidIndexId,
00442 1,
00443 {
00444 ObjectIdAttributeNumber,
00445 0,
00446 0,
00447 0
00448 },
00449 32
00450 },
00451 {ForeignTableRelationId,
00452 ForeignTableRelidIndexId,
00453 1,
00454 {
00455 Anum_pg_foreign_table_ftrelid,
00456 0,
00457 0,
00458 0
00459 },
00460 128
00461 },
00462 {IndexRelationId,
00463 IndexRelidIndexId,
00464 1,
00465 {
00466 Anum_pg_index_indexrelid,
00467 0,
00468 0,
00469 0
00470 },
00471 1024
00472 },
00473 {LanguageRelationId,
00474 LanguageNameIndexId,
00475 1,
00476 {
00477 Anum_pg_language_lanname,
00478 0,
00479 0,
00480 0
00481 },
00482 4
00483 },
00484 {LanguageRelationId,
00485 LanguageOidIndexId,
00486 1,
00487 {
00488 ObjectIdAttributeNumber,
00489 0,
00490 0,
00491 0
00492 },
00493 4
00494 },
00495 {NamespaceRelationId,
00496 NamespaceNameIndexId,
00497 1,
00498 {
00499 Anum_pg_namespace_nspname,
00500 0,
00501 0,
00502 0
00503 },
00504 256
00505 },
00506 {NamespaceRelationId,
00507 NamespaceOidIndexId,
00508 1,
00509 {
00510 ObjectIdAttributeNumber,
00511 0,
00512 0,
00513 0
00514 },
00515 256
00516 },
00517 {OperatorRelationId,
00518 OperatorNameNspIndexId,
00519 4,
00520 {
00521 Anum_pg_operator_oprname,
00522 Anum_pg_operator_oprleft,
00523 Anum_pg_operator_oprright,
00524 Anum_pg_operator_oprnamespace
00525 },
00526 1024
00527 },
00528 {OperatorRelationId,
00529 OperatorOidIndexId,
00530 1,
00531 {
00532 ObjectIdAttributeNumber,
00533 0,
00534 0,
00535 0
00536 },
00537 1024
00538 },
00539 {OperatorFamilyRelationId,
00540 OpfamilyAmNameNspIndexId,
00541 3,
00542 {
00543 Anum_pg_opfamily_opfmethod,
00544 Anum_pg_opfamily_opfname,
00545 Anum_pg_opfamily_opfnamespace,
00546 0
00547 },
00548 64
00549 },
00550 {OperatorFamilyRelationId,
00551 OpfamilyOidIndexId,
00552 1,
00553 {
00554 ObjectIdAttributeNumber,
00555 0,
00556 0,
00557 0
00558 },
00559 64
00560 },
00561 {ProcedureRelationId,
00562 ProcedureNameArgsNspIndexId,
00563 3,
00564 {
00565 Anum_pg_proc_proname,
00566 Anum_pg_proc_proargtypes,
00567 Anum_pg_proc_pronamespace,
00568 0
00569 },
00570 2048
00571 },
00572 {ProcedureRelationId,
00573 ProcedureOidIndexId,
00574 1,
00575 {
00576 ObjectIdAttributeNumber,
00577 0,
00578 0,
00579 0
00580 },
00581 2048
00582 },
00583 {RangeRelationId,
00584 RangeTypidIndexId,
00585 1,
00586 {
00587 Anum_pg_range_rngtypid,
00588 0,
00589 0,
00590 0
00591 },
00592 64
00593 },
00594 {RelationRelationId,
00595 ClassNameNspIndexId,
00596 2,
00597 {
00598 Anum_pg_class_relname,
00599 Anum_pg_class_relnamespace,
00600 0,
00601 0
00602 },
00603 1024
00604 },
00605 {RelationRelationId,
00606 ClassOidIndexId,
00607 1,
00608 {
00609 ObjectIdAttributeNumber,
00610 0,
00611 0,
00612 0
00613 },
00614 1024
00615 },
00616 {RewriteRelationId,
00617 RewriteRelRulenameIndexId,
00618 2,
00619 {
00620 Anum_pg_rewrite_ev_class,
00621 Anum_pg_rewrite_rulename,
00622 0,
00623 0
00624 },
00625 1024
00626 },
00627 {StatisticRelationId,
00628 StatisticRelidAttnumInhIndexId,
00629 3,
00630 {
00631 Anum_pg_statistic_starelid,
00632 Anum_pg_statistic_staattnum,
00633 Anum_pg_statistic_stainherit,
00634 0
00635 },
00636 1024
00637 },
00638 {TableSpaceRelationId,
00639 TablespaceOidIndexId,
00640 1,
00641 {
00642 ObjectIdAttributeNumber,
00643 0,
00644 0,
00645 0,
00646 },
00647 16
00648 },
00649 {TSConfigMapRelationId,
00650 TSConfigMapIndexId,
00651 3,
00652 {
00653 Anum_pg_ts_config_map_mapcfg,
00654 Anum_pg_ts_config_map_maptokentype,
00655 Anum_pg_ts_config_map_mapseqno,
00656 0
00657 },
00658 4
00659 },
00660 {TSConfigRelationId,
00661 TSConfigNameNspIndexId,
00662 2,
00663 {
00664 Anum_pg_ts_config_cfgname,
00665 Anum_pg_ts_config_cfgnamespace,
00666 0,
00667 0
00668 },
00669 16
00670 },
00671 {TSConfigRelationId,
00672 TSConfigOidIndexId,
00673 1,
00674 {
00675 ObjectIdAttributeNumber,
00676 0,
00677 0,
00678 0
00679 },
00680 16
00681 },
00682 {TSDictionaryRelationId,
00683 TSDictionaryNameNspIndexId,
00684 2,
00685 {
00686 Anum_pg_ts_dict_dictname,
00687 Anum_pg_ts_dict_dictnamespace,
00688 0,
00689 0
00690 },
00691 16
00692 },
00693 {TSDictionaryRelationId,
00694 TSDictionaryOidIndexId,
00695 1,
00696 {
00697 ObjectIdAttributeNumber,
00698 0,
00699 0,
00700 0
00701 },
00702 16
00703 },
00704 {TSParserRelationId,
00705 TSParserNameNspIndexId,
00706 2,
00707 {
00708 Anum_pg_ts_parser_prsname,
00709 Anum_pg_ts_parser_prsnamespace,
00710 0,
00711 0
00712 },
00713 4
00714 },
00715 {TSParserRelationId,
00716 TSParserOidIndexId,
00717 1,
00718 {
00719 ObjectIdAttributeNumber,
00720 0,
00721 0,
00722 0
00723 },
00724 4
00725 },
00726 {TSTemplateRelationId,
00727 TSTemplateNameNspIndexId,
00728 2,
00729 {
00730 Anum_pg_ts_template_tmplname,
00731 Anum_pg_ts_template_tmplnamespace,
00732 0,
00733 0
00734 },
00735 16
00736 },
00737 {TSTemplateRelationId,
00738 TSTemplateOidIndexId,
00739 1,
00740 {
00741 ObjectIdAttributeNumber,
00742 0,
00743 0,
00744 0
00745 },
00746 16
00747 },
00748 {TypeRelationId,
00749 TypeNameNspIndexId,
00750 2,
00751 {
00752 Anum_pg_type_typname,
00753 Anum_pg_type_typnamespace,
00754 0,
00755 0
00756 },
00757 1024
00758 },
00759 {TypeRelationId,
00760 TypeOidIndexId,
00761 1,
00762 {
00763 ObjectIdAttributeNumber,
00764 0,
00765 0,
00766 0
00767 },
00768 1024
00769 },
00770 {UserMappingRelationId,
00771 UserMappingOidIndexId,
00772 1,
00773 {
00774 ObjectIdAttributeNumber,
00775 0,
00776 0,
00777 0
00778 },
00779 128
00780 },
00781 {UserMappingRelationId,
00782 UserMappingUserServerIndexId,
00783 2,
00784 {
00785 Anum_pg_user_mapping_umuser,
00786 Anum_pg_user_mapping_umserver,
00787 0,
00788 0
00789 },
00790 128
00791 }
00792 };
00793
00794 static CatCache *SysCache[
00795 lengthof(cacheinfo)];
00796 static int SysCacheSize = lengthof(cacheinfo);
00797 static bool CacheInitialized = false;
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808 void
00809 InitCatalogCache(void)
00810 {
00811 int cacheId;
00812
00813 Assert(!CacheInitialized);
00814
00815 MemSet(SysCache, 0, sizeof(SysCache));
00816
00817 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
00818 {
00819 SysCache[cacheId] = InitCatCache(cacheId,
00820 cacheinfo[cacheId].reloid,
00821 cacheinfo[cacheId].indoid,
00822 cacheinfo[cacheId].nkeys,
00823 cacheinfo[cacheId].key,
00824 cacheinfo[cacheId].nbuckets);
00825 if (!PointerIsValid(SysCache[cacheId]))
00826 elog(ERROR, "could not initialize cache %u (%d)",
00827 cacheinfo[cacheId].reloid, cacheId);
00828 }
00829 CacheInitialized = true;
00830 }
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845 void
00846 InitCatalogCachePhase2(void)
00847 {
00848 int cacheId;
00849
00850 Assert(CacheInitialized);
00851
00852 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
00853 InitCatCachePhase2(SysCache[cacheId], true);
00854 }
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873 HeapTuple
00874 SearchSysCache(int cacheId,
00875 Datum key1,
00876 Datum key2,
00877 Datum key3,
00878 Datum key4)
00879 {
00880 if (cacheId < 0 || cacheId >= SysCacheSize ||
00881 !PointerIsValid(SysCache[cacheId]))
00882 elog(ERROR, "invalid cache ID: %d", cacheId);
00883
00884 return SearchCatCache(SysCache[cacheId], key1, key2, key3, key4);
00885 }
00886
00887
00888
00889
00890
00891 void
00892 ReleaseSysCache(HeapTuple tuple)
00893 {
00894 ReleaseCatCache(tuple);
00895 }
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905 HeapTuple
00906 SearchSysCacheCopy(int cacheId,
00907 Datum key1,
00908 Datum key2,
00909 Datum key3,
00910 Datum key4)
00911 {
00912 HeapTuple tuple,
00913 newtuple;
00914
00915 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
00916 if (!HeapTupleIsValid(tuple))
00917 return tuple;
00918 newtuple = heap_copytuple(tuple);
00919 ReleaseSysCache(tuple);
00920 return newtuple;
00921 }
00922
00923
00924
00925
00926
00927
00928
00929 bool
00930 SearchSysCacheExists(int cacheId,
00931 Datum key1,
00932 Datum key2,
00933 Datum key3,
00934 Datum key4)
00935 {
00936 HeapTuple tuple;
00937
00938 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
00939 if (!HeapTupleIsValid(tuple))
00940 return false;
00941 ReleaseSysCache(tuple);
00942 return true;
00943 }
00944
00945
00946
00947
00948
00949
00950
00951
00952 Oid
00953 GetSysCacheOid(int cacheId,
00954 Datum key1,
00955 Datum key2,
00956 Datum key3,
00957 Datum key4)
00958 {
00959 HeapTuple tuple;
00960 Oid result;
00961
00962 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
00963 if (!HeapTupleIsValid(tuple))
00964 return InvalidOid;
00965 result = HeapTupleGetOid(tuple);
00966 ReleaseSysCache(tuple);
00967 return result;
00968 }
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979 HeapTuple
00980 SearchSysCacheAttName(Oid relid, const char *attname)
00981 {
00982 HeapTuple tuple;
00983
00984 tuple = SearchSysCache2(ATTNAME,
00985 ObjectIdGetDatum(relid),
00986 CStringGetDatum(attname));
00987 if (!HeapTupleIsValid(tuple))
00988 return NULL;
00989 if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
00990 {
00991 ReleaseSysCache(tuple);
00992 return NULL;
00993 }
00994 return tuple;
00995 }
00996
00997
00998
00999
01000
01001
01002 HeapTuple
01003 SearchSysCacheCopyAttName(Oid relid, const char *attname)
01004 {
01005 HeapTuple tuple,
01006 newtuple;
01007
01008 tuple = SearchSysCacheAttName(relid, attname);
01009 if (!HeapTupleIsValid(tuple))
01010 return tuple;
01011 newtuple = heap_copytuple(tuple);
01012 ReleaseSysCache(tuple);
01013 return newtuple;
01014 }
01015
01016
01017
01018
01019
01020
01021 bool
01022 SearchSysCacheExistsAttName(Oid relid, const char *attname)
01023 {
01024 HeapTuple tuple;
01025
01026 tuple = SearchSysCacheAttName(relid, attname);
01027 if (!HeapTupleIsValid(tuple))
01028 return false;
01029 ReleaseSysCache(tuple);
01030 return true;
01031 }
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053 Datum
01054 SysCacheGetAttr(int cacheId, HeapTuple tup,
01055 AttrNumber attributeNumber,
01056 bool *isNull)
01057 {
01058
01059
01060
01061
01062
01063
01064 if (cacheId < 0 || cacheId >= SysCacheSize ||
01065 !PointerIsValid(SysCache[cacheId]))
01066 elog(ERROR, "invalid cache ID: %d", cacheId);
01067 if (!PointerIsValid(SysCache[cacheId]->cc_tupdesc))
01068 {
01069 InitCatCachePhase2(SysCache[cacheId], false);
01070 Assert(PointerIsValid(SysCache[cacheId]->cc_tupdesc));
01071 }
01072
01073 return heap_getattr(tup, attributeNumber,
01074 SysCache[cacheId]->cc_tupdesc,
01075 isNull);
01076 }
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088 uint32
01089 GetSysCacheHashValue(int cacheId,
01090 Datum key1,
01091 Datum key2,
01092 Datum key3,
01093 Datum key4)
01094 {
01095 if (cacheId < 0 || cacheId >= SysCacheSize ||
01096 !PointerIsValid(SysCache[cacheId]))
01097 elog(ERROR, "invalid cache ID: %d", cacheId);
01098
01099 return GetCatCacheHashValue(SysCache[cacheId], key1, key2, key3, key4);
01100 }
01101
01102
01103
01104
01105 struct catclist *
01106 SearchSysCacheList(int cacheId, int nkeys,
01107 Datum key1, Datum key2, Datum key3, Datum key4)
01108 {
01109 if (cacheId < 0 || cacheId >= SysCacheSize ||
01110 !PointerIsValid(SysCache[cacheId]))
01111 elog(ERROR, "invalid cache ID: %d", cacheId);
01112
01113 return SearchCatCacheList(SysCache[cacheId], nkeys,
01114 key1, key2, key3, key4);
01115 }