1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Add system indexes to match all caches.

Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.
This commit is contained in:
Bruce Momjian
1999-11-22 17:56:41 +00:00
parent e30c2d67ef
commit fc955b14ea
75 changed files with 1265 additions and 634 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.50 1999/11/07 23:07:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.51 1999/11/22 17:55:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,7 +44,7 @@ getTypeOutAndElem(Oid type, Oid *typOutput, Oid *typElem)
{
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.56 1999/11/07 23:07:47 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.57 1999/11/22 17:55:52 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -309,7 +309,7 @@ TupleDescInitEntry(TupleDesc desc,
* -cim 6/14/90
* ----------------
*/
tuple = SearchSysCacheTuple(TYPOID,
tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typeid),
0, 0, 0);
if (!HeapTupleIsValid(tuple))

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.37 1999/10/23 03:13:20 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.38 1999/11/22 17:55:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -479,7 +479,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
if (!IsBootstrapProcessingMode())
{
tuple = SearchSysCacheTuple(OPROID,
tuple = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(operatorObjectId),
0, 0, 0);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.50 1999/08/09 01:39:19 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.51 1999/11/22 17:55:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -149,7 +149,7 @@ l1:
buf = _bt_getbuf(rel, blkno, BT_WRITE);
goto l1;/* continue from the begin */
}
elog(ERROR, "Cannot insert a duplicate key into a unique index");
elog(ERROR, "Cannot insert a duplicate key into unique index %s", RelationGetRelationName(rel));
}
/* htup null so no buffer to release */
/* get next offnum */

View File

@@ -4,7 +4,7 @@
# Makefile for catalog
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.17 1999/03/27 17:25:09 tgl Exp $
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.18 1999/11/22 17:55:56 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -38,7 +38,8 @@ LOCALBKI_SRCS= $(addprefix ../../include/catalog/, \
pg_rewrite.h pg_listener.h pg_description.h indexing.h \
)
global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS)
global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS) \
$(addprefix ../../include/catalog/, indexing.h)
ifneq ($(PORTNAME), win)
sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(GLOBALBKI_SRCS) > $@ 2>global1.description
else

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.29 1999/11/07 23:08:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.30 1999/11/22 17:55:56 momjian Exp $
*
* NOTES
* See acl.h.
@@ -350,7 +350,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
int32 result;
Relation relation;
tuple = SearchSysCacheTuple(USENAME,
tuple = SearchSysCacheTuple(USERNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -469,7 +469,7 @@ pg_ownercheck(char *usename,
AclId user_id,
owner_id = 0;
tuple = SearchSysCacheTuple(USENAME,
tuple = SearchSysCacheTuple(USERNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -493,13 +493,13 @@ pg_ownercheck(char *usename,
0, 0, 0);
switch (cacheid)
{
case OPROID:
case OPEROID:
if (!HeapTupleIsValid(tuple))
elog(ERROR, "pg_ownercheck: operator %ld not found",
PointerGetDatum(value));
owner_id = ((Form_pg_operator) GETSTRUCT(tuple))->oprowner;
break;
case PRONAME:
case PROCNAME:
if (!HeapTupleIsValid(tuple))
elog(ERROR, "pg_ownercheck: function \"%s\" not found",
value);
@@ -511,7 +511,7 @@ pg_ownercheck(char *usename,
value);
owner_id = ((Form_pg_class) GETSTRUCT(tuple))->relowner;
break;
case TYPNAME:
case TYPENAME:
if (!HeapTupleIsValid(tuple))
elog(ERROR, "pg_ownercheck: type \"%s\" not found",
value);
@@ -535,7 +535,7 @@ pg_func_ownercheck(char *usename,
AclId user_id,
owner_id;
tuple = SearchSysCacheTuple(USENAME,
tuple = SearchSysCacheTuple(USERNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -555,7 +555,7 @@ pg_func_ownercheck(char *usename,
return 1;
}
tuple = SearchSysCacheTuple(PRONAME,
tuple = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(funcname),
Int32GetDatum(nargs),
PointerGetDatum(arglist),
@@ -577,7 +577,7 @@ pg_aggr_ownercheck(char *usename,
AclId user_id,
owner_id;
tuple = SearchSysCacheTuple(USENAME,
tuple = SearchSysCacheTuple(USERNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.25 1999/07/17 20:16:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.26 1999/11/22 17:55:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -151,7 +151,7 @@ fillatt(TupleDesc tupleDesc)
for (i = 0; i < natts;)
{
tuple = SearchSysCacheTuple(TYPOID,
tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum((*attributeP)->atttypid),
0, 0, 0);
if (!HeapTupleIsValid(tuple))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.108 1999/11/16 04:13:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.109 1999/11/22 17:55:57 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -964,7 +964,7 @@ RelationRemoveInheritance(Relation relation)
tuple = heap_getnext(scan, 0);
if (HeapTupleIsValid(tuple))
{
Oid subclass = ((Form_pg_inherits) GETSTRUCT(tuple))->inhrel;
Oid subclass = ((Form_pg_inherits) GETSTRUCT(tuple))->inhrelid;
heap_endscan(scan);
heap_close(catalogRelation, RowExclusiveLock);
@@ -979,7 +979,7 @@ RelationRemoveInheritance(Relation relation)
* so we can trash it. First we remove dead INHERITS tuples.
* ----------------
*/
entry.sk_attno = Anum_pg_inherits_inhrel;
entry.sk_attno = Anum_pg_inherits_inhrelid;
scan = heap_beginscan(catalogRelation,
false,
@@ -1003,7 +1003,7 @@ RelationRemoveInheritance(Relation relation)
catalogRelation = heap_openr(InheritancePrecidenceListRelationName,
RowExclusiveLock);
entry.sk_attno = Anum_pg_ipl_iplrel;
entry.sk_attno = Anum_pg_ipl_iplrelid;
scan = heap_beginscan(catalogRelation,
false,
@@ -1157,7 +1157,7 @@ RelationTruncateIndexes(Relation heapRelation)
{
funcInfo = &fInfo;
FIsetnArgs(funcInfo, numberOfAttributes);
procTuple = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(procId),
procTuple = SearchSysCacheTuple(PROCOID, ObjectIdGetDatum(procId),
0, 0, 0);
if (!HeapTupleIsValid(procTuple))
elog(ERROR, "RelationTruncateIndexes: index procedure not found");

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.96 1999/11/21 20:01:10 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.97 1999/11/22 17:55:57 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -157,7 +157,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
funcname = FIgetname(funcInfo);
nargs = FIgetnArgs(funcInfo);
argtypes = FIgetArglist(funcInfo);
tuple = SearchSysCacheTuple(PRONAME,
tuple = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(funcname),
Int32GetDatum(nargs),
PointerGetDatum(argtypes),
@@ -171,7 +171,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
/*
* Look up the return type in pg_type for the type length.
*/
tuple = SearchSysCacheTuple(TYPOID,
tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(retType),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -317,7 +317,7 @@ ConstructTupleDescriptor(Oid heapoid,
{
HeapTuple tup;
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(IndexKeyType->name),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -1028,7 +1028,7 @@ index_create(char *heapRelationName,
{
HeapTuple proc_tup;
proc_tup = SearchSysCacheTuple(PRONAME,
proc_tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(FIgetname(funcInfo)),
Int32GetDatum(FIgetnArgs(funcInfo)),
PointerGetDatum(FIgetArglist(funcInfo)),

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.50 1999/11/01 04:00:56 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.51 1999/11/22 17:55:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,34 +26,49 @@
#include "utils/syscache.h"
/*
* Names of indices on the following system catalogs:
*
* pg_attribute
* pg_proc
* pg_type
* pg_naming
* pg_class
* pg_attrdef
* pg_relcheck
* pg_trigger
* Names of indices - they match all system caches
*/
char *Name_pg_amop_indices[Num_pg_amop_indices] = {AccessMethodOpidIndex,
AccessMethodStrategyIndex};
char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
AttributeNumIndex, AttributeRelidIndex};
char *Name_pg_index_indices[Num_pg_index_indices] = {IndexRelidIndex};
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex,
ProcedureOidIndex};
char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex,
TypeOidIndex};
char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex,
ClassOidIndex};
char *Name_pg_attrdef_indices[Num_pg_attrdef_indices] = {AttrDefaultIndex};
char *Name_pg_relcheck_indices[Num_pg_relcheck_indices] = {RelCheckIndex};
char *Name_pg_trigger_indices[Num_pg_trigger_indices] = {TriggerRelidIndex,
TriggerConstrNameIndex, TriggerConstrRelidIndex};
char *Name_pg_description_indices[Num_pg_description_indices] = {DescriptionObjIndex};
char *Name_pg_aggregate_indices[Num_pg_aggregate_indices] =
{AggregateNameTypeIndex};
char *Name_pg_am_indices[Num_pg_am_indices] =
{AmNameIndex};
char *Name_pg_amop_indices[Num_pg_amop_indices] =
{AccessMethodOpidIndex, AccessMethodStrategyIndex};
char *Name_pg_attr_indices[Num_pg_attr_indices] =
{AttributeRelidNameIndex, AttributeRelidNumIndex};
char *Name_pg_attrdef_indices[Num_pg_attrdef_indices] =
{AttrDefaultIndex};
char *Name_pg_class_indices[Num_pg_class_indices] =
{ClassNameIndex, ClassOidIndex};
char *Name_pg_group_indices[Num_pg_group_indices] =
{GroupNameIndex, GroupSysidIndex};
char *Name_pg_index_indices[Num_pg_index_indices] =
{IndexRelidIndex};
char *Name_pg_inherits_indices[Num_pg_inherits_indices] =
{InheritsRelidSeqnoIndex};
char *Name_pg_language_indices[Num_pg_language_indices] =
{LanguageOidIndex, LanguageNameIndex};
char *Name_pg_listener_indices[Num_pg_listener_indices] =
{ListenerRelnamePidIndex};
char *Name_pg_opclass_indices[Num_pg_opclass_indices] =
{OpclassNameIndex, OpclassDeftypeIndex};
char *Name_pg_operator_indices[Num_pg_operator_indices] =
{OperatorOidIndex, OperatorNameIndex};
char *Name_pg_proc_indices[Num_pg_proc_indices] =
{ProcedureOidIndex, ProcedureNameIndex};
char *Name_pg_relcheck_indices[Num_pg_relcheck_indices] =
{RelCheckIndex};
char *Name_pg_rewrite_indices[Num_pg_rewrite_indices] =
{RewriteOidIndex, RewriteRulenameIndex};
char *Name_pg_shadow_indices[Num_pg_shadow_indices] =
{ShadowNameIndex, ShadowSysidIndex};
char *Name_pg_trigger_indices[Num_pg_trigger_indices] =
{TriggerRelidIndex, TriggerConstrNameIndex, TriggerConstrRelidIndex};
char *Name_pg_type_indices[Num_pg_type_indices] =
{TypeNameIndex, TypeOidIndex};
char *Name_pg_description_indices[Num_pg_description_indices] =
{DescriptionObjIndex};
@@ -264,6 +279,56 @@ CatalogIndexFetchTuple(Relation heapRelation,
* (that is, functional or normal) and what arguments the cache lookup
* requires. Each routine returns the heap tuple that qualifies.
*/
HeapTuple
AggregateNameTypeIndexScan(Relation heapRelation, char *aggName, Oid aggType)
{
Relation idesc;
ScanKeyData skey[2];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(aggName));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(aggType));
idesc = index_openr(AggregateNameTypeIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);
return tuple;
}
HeapTuple
AmNameIndexScan(Relation heapRelation, char *amName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(amName));
idesc = index_openr(AmNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
AccessMethodOpidIndexScan(Relation heapRelation,
Oid claid,
@@ -335,9 +400,10 @@ AccessMethodStrategyIndexScan(Relation heapRelation,
return tuple;
}
HeapTuple
AttributeNameIndexScan(Relation heapRelation,
AttributeRelidNameIndexScan(Relation heapRelation,
Oid relid,
char *attname)
{
@@ -357,7 +423,7 @@ AttributeNameIndexScan(Relation heapRelation,
(RegProcedure) F_NAMEEQ,
NameGetDatum(attname));
idesc = index_openr(AttributeNameIndex);
idesc = index_openr(AttributeRelidNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);
@@ -367,7 +433,7 @@ AttributeNameIndexScan(Relation heapRelation,
HeapTuple
AttributeNumIndexScan(Relation heapRelation,
AttributeRelidNumIndexScan(Relation heapRelation,
Oid relid,
AttrNumber attnum)
{
@@ -387,7 +453,7 @@ AttributeNumIndexScan(Relation heapRelation,
(RegProcedure) F_INT2EQ,
Int16GetDatum(attnum));
idesc = index_openr(AttributeNumIndex);
idesc = index_openr(AttributeRelidNumIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);
@@ -395,6 +461,92 @@ AttributeNumIndexScan(Relation heapRelation,
return tuple;
}
HeapTuple
OpclassDeftypeIndexScan(Relation heapRelation, Oid defType)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(defType));
idesc = index_openr(OpclassDeftypeIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
OpclassNameIndexScan(Relation heapRelation, char *opcName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(opcName));
idesc = index_openr(OpclassNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
GroupNameIndexScan(Relation heapRelation, char *groName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(groName));
idesc = index_openr(GroupNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
GroupSysidIndexScan(Relation heapRelation, int4 sysId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_INT4EQ,
Int32GetDatum(sysId));
idesc = index_openr(GroupSysidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
IndexRelidIndexScan(Relation heapRelation, Oid relid)
{
@@ -417,9 +569,59 @@ IndexRelidIndexScan(Relation heapRelation, Oid relid)
}
HeapTuple
InheritsRelidSeqnoIndexScan(Relation heapRelation,
Oid relid,
int4 seqno)
{
Relation idesc;
ScanKeyData skey[2];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(relid));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_INT4EQ,
Int32GetDatum(seqno));
idesc = index_openr(InheritsRelidSeqnoIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);
return tuple;
}
HeapTuple
ProcedureOidIndexScan(Relation heapRelation, Oid procId)
LanguageNameIndexScan(Relation heapRelation, char *lanName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(lanName));
idesc = index_openr(LanguageNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
LanguageOidIndexScan(Relation heapRelation, Oid lanId)
{
Relation idesc;
ScanKeyData skey[1];
@@ -429,9 +631,102 @@ ProcedureOidIndexScan(Relation heapRelation, Oid procId)
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(procId));
ObjectIdGetDatum(lanId));
idesc = index_openr(ProcedureOidIndex);
idesc = index_openr(LanguageOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
ListenerRelnamePidIndexScan(Relation heapRelation, char *relName, int4 pid)
{
Relation idesc;
ScanKeyData skey[2];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(relName));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_INT4EQ,
Int32GetDatum(pid));
idesc = index_openr(ListenerRelnamePidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);
return tuple;
}
HeapTuple
OperatorNameIndexScan(Relation heapRelation,
char *oprName,
Oid oprLeft,
Oid oprRight,
char oprKind)
{
Relation idesc;
ScanKeyData skey[4];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(oprName));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(oprLeft));
ScanKeyEntryInitialize(&skey[2],
(bits16) 0x0,
(AttrNumber) 3,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(oprRight));
ScanKeyEntryInitialize(&skey[3],
(bits16) 0x0,
(AttrNumber) 4,
(RegProcedure) F_CHAREQ,
CharGetDatum(oprKind));
idesc = index_openr(OperatorNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 4);
index_close(idesc);
return tuple;
}
HeapTuple
OperatorOidIndexScan(Relation heapRelation, Oid oprId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(oprId));
idesc = index_openr(OperatorOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
@@ -478,7 +773,7 @@ ProcedureNameIndexScan(Relation heapRelation,
HeapTuple
TypeOidIndexScan(Relation heapRelation, Oid typeId)
ProcedureOidIndexScan(Relation heapRelation, Oid procId)
{
Relation idesc;
ScanKeyData skey[1];
@@ -488,31 +783,9 @@ TypeOidIndexScan(Relation heapRelation, Oid typeId)
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(typeId));
ObjectIdGetDatum(procId));
idesc = index_openr(TypeOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
TypeNameIndexScan(Relation heapRelation, char *typeName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(typeName));
idesc = index_openr(TypeNameIndex);
idesc = index_openr(ProcedureOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
@@ -562,3 +835,134 @@ ClassOidIndexScan(Relation heapRelation, Oid relId)
return tuple;
}
HeapTuple
RewriteRulenameIndexScan(Relation heapRelation, char *ruleName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(ruleName));
idesc = index_openr(RewriteRulenameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
RewriteOidIndexScan(Relation heapRelation, Oid rewriteId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(rewriteId));
idesc = index_openr(RewriteOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
TypeNameIndexScan(Relation heapRelation, char *typeName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(typeName));
idesc = index_openr(TypeNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
TypeOidIndexScan(Relation heapRelation, Oid typeId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(typeId));
idesc = index_openr(TypeOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
ShadowNameIndexScan(Relation heapRelation, char *useName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(useName));
idesc = index_openr(ShadowNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_INT4EQ,
Int32GetDatum(sysId));
idesc = index_openr(ShadowSysidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.25 1999/09/18 19:06:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.26 1999/11/22 17:55:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#include "access/heapam.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_aggregate.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
@@ -83,7 +84,7 @@ AggregateCreate(char *aggName,
if (!aggtransfn1Name && !aggtransfn2Name)
elog(ERROR, "AggregateCreate: aggregate must have at least one transition function");
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(aggbasetypeName),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -92,7 +93,7 @@ AggregateCreate(char *aggName,
if (aggtransfn1Name)
{
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(aggtransfn1typeName),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -102,7 +103,7 @@ AggregateCreate(char *aggName,
fnArgs[0] = xret1;
fnArgs[1] = xbase;
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(aggtransfn1Name),
Int32GetDatum(2),
PointerGetDatum(fnArgs),
@@ -122,7 +123,7 @@ AggregateCreate(char *aggName,
if (aggtransfn2Name)
{
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(aggtransfn2typeName),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -132,7 +133,7 @@ AggregateCreate(char *aggName,
fnArgs[0] = xret2;
fnArgs[1] = 0;
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(aggtransfn2Name),
Int32GetDatum(1),
PointerGetDatum(fnArgs),
@@ -168,7 +169,7 @@ AggregateCreate(char *aggName,
{
fnArgs[0] = xret1;
fnArgs[1] = xret2;
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(aggfinalfnName),
Int32GetDatum(2),
PointerGetDatum(fnArgs),
@@ -242,6 +243,16 @@ AggregateCreate(char *aggName,
elog(ERROR, "AggregateCreate: heap_formtuple failed");
if (!OidIsValid(heap_insert(aggdesc, tup)))
elog(ERROR, "AggregateCreate: heap_insert failed");
if (RelationGetForm(aggdesc)->relhasindex)
{
Relation idescs[Num_pg_aggregate_indices];
CatalogOpenIndices(Num_pg_aggregate_indices, Name_pg_aggregate_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_aggregate_indices, aggdesc, tup);
CatalogCloseIndices(Num_pg_aggregate_indices, idescs);
}
heap_close(aggdesc, RowExclusiveLock);
}
@@ -301,7 +312,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
heap_close(aggRel, AccessShareLock);
tup = SearchSysCacheTuple(TYPOID,
tup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(transtype),
0, 0, 0);
if (!HeapTupleIsValid(tup))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.42 1999/09/18 19:06:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.43 1999/11/22 17:55:58 momjian Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
@@ -18,6 +18,7 @@
#include "access/heapam.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
@@ -292,6 +293,15 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
heap_insert(pg_operator_desc, tup);
operatorObjectId = tup->t_data->t_oid;
if (RelationGetForm(pg_operator_desc)->relhasindex)
{
Relation idescs[Num_pg_operator_indices];
CatalogOpenIndices(Num_pg_operator_indices, Name_pg_operator_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_operator_indices, pg_operator_desc, tup);
CatalogCloseIndices(Num_pg_operator_indices, idescs);
}
/* ----------------
* free the tuple and return the operator oid
* ----------------
@@ -563,7 +573,7 @@ OperatorDef(char *operatorName,
typeId[1] = rightTypeId;
nargs = 2;
}
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(procedureName),
Int32GetDatum(nargs),
PointerGetDatum(typeId),
@@ -588,7 +598,7 @@ OperatorDef(char *operatorName,
typeId[2] = INT2OID; /* attribute number */
typeId[3] = 0; /* value - can be any type */
typeId[4] = INT4OID; /* flags - left or right selectivity */
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(restrictionName),
Int32GetDatum(5),
PointerGetDatum(typeId),
@@ -614,7 +624,7 @@ OperatorDef(char *operatorName,
typeId[3] = OIDOID; /* relation OID 2 */
typeId[4] = INT2OID; /* attribute number 2 */
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(joinName),
Int32GetDatum(5),
PointerGetDatum(typeId),
@@ -759,7 +769,6 @@ OperatorDef(char *operatorName,
/*
* If we are adding to an operator shell, get its t_self
*/
if (operatorObjectId)
{
opKey[0].sk_argument = PointerGetDatum(operatorName);
@@ -797,6 +806,16 @@ OperatorDef(char *operatorName,
heap_insert(pg_operator_desc, tup);
operatorObjectId = tup->t_data->t_oid;
}
if (RelationGetForm(pg_operator_desc)->relhasindex)
{
Relation idescs[Num_pg_operator_indices];
CatalogOpenIndices(Num_pg_operator_indices, Name_pg_operator_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_operator_indices, pg_operator_desc, tup);
CatalogCloseIndices(Num_pg_operator_indices, idescs);
}
heap_close(pg_operator_desc, RowExclusiveLock);
@@ -904,7 +923,15 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
setheapoverride(true);
heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
if (RelationGetForm(pg_operator_desc)->relhasindex)
{
Relation idescs[Num_pg_operator_indices];
CatalogOpenIndices(Num_pg_operator_indices, Name_pg_operator_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_operator_indices, pg_operator_desc, tup);
CatalogCloseIndices(Num_pg_operator_indices, idescs);
}
}
}
heap_endscan(pg_operator_scan);
@@ -931,6 +958,15 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
if (RelationGetForm(pg_operator_desc)->relhasindex)
{
Relation idescs[Num_pg_operator_indices];
CatalogOpenIndices(Num_pg_operator_indices, Name_pg_operator_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_operator_indices, pg_operator_desc, tup);
CatalogCloseIndices(Num_pg_operator_indices, idescs);
}
values[Anum_pg_operator_oprcom - 1] = (Datum) NULL;
replaces[Anum_pg_operator_oprcom - 1] = ' ';
}
@@ -961,10 +997,20 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
setheapoverride(true);
heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
if (RelationGetForm(pg_operator_desc)->relhasindex)
{
Relation idescs[Num_pg_operator_indices];
CatalogOpenIndices(Num_pg_operator_indices, Name_pg_operator_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_operator_indices, pg_operator_desc, tup);
CatalogCloseIndices(Num_pg_operator_indices, idescs);
}
}
heap_endscan(pg_operator_scan);
heap_close(pg_operator_desc, RowExclusiveLock);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.35 1999/09/30 10:31:42 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.36 1999/11/22 17:55:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -109,7 +109,7 @@ ProcedureCreate(char *procedureName,
typev[parameterCount++] = toid;
}
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(procedureName),
UInt16GetDatum(parameterCount),
PointerGetDatum(typev),
@@ -157,7 +157,7 @@ ProcedureCreate(char *procedureName,
}
}
tup = SearchSysCacheTuple(LANNAME,
tup = SearchSysCacheTuple(LANGNAME,
PointerGetDatum(languageName),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.41 1999/09/18 19:06:34 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.42 1999/11/22 17:55:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -395,7 +395,7 @@ TypeCreate(char *typeName,
*/
MemSet(argList, 0, 8 * sizeof(Oid));
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(procname),
Int32GetDatum(1),
PointerGetDatum(argList),
@@ -425,7 +425,7 @@ TypeCreate(char *typeName,
nargs = 3;
argList[2] = INT4OID;
}
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(procname),
Int32GetDatum(nargs),
PointerGetDatum(argList),
@@ -536,7 +536,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
pg_type_desc = heap_openr(TypeRelationName, RowExclusiveLock);
oldtup = SearchSysCacheTupleCopy(TYPNAME,
oldtup = SearchSysCacheTupleCopy(TYPENAME,
PointerGetDatum(oldTypeName),
0, 0, 0);
@@ -546,7 +546,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
elog(ERROR, "TypeRename: type %s not defined", oldTypeName);
}
newtup = SearchSysCacheTuple(TYPNAME,
newtup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(newTypeName),
0, 0, 0);
if (HeapTupleIsValid(newtup))

View File

@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.54 1999/09/18 19:06:39 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.55 1999/11/22 17:55:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,6 +79,7 @@
#include "access/heapam.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_listener.h"
#include "commands/async.h"
#include "lib/dllist.h"
@@ -464,7 +465,6 @@ AtCommit_Notify()
if (listenerPID == MyProcPid)
{
/*
* Self-notify: no need to bother with table update.
* Indeed, we *must not* clear the notification field in
@@ -490,7 +490,6 @@ AtCommit_Notify()
*/
if (kill(listenerPID, SIGUSR2) < 0)
{
/*
* Get rid of pg_listener entry if it refers to a PID
* that no longer exists. Presumably, that backend
@@ -511,6 +510,14 @@ AtCommit_Notify()
rTuple = heap_modifytuple(lTuple, lRel,
value, nulls, repl);
heap_replace(lRel, &lTuple->t_self, rTuple, NULL);
if (RelationGetForm(lRel)->relhasindex)
{
Relation idescs[Num_pg_listener_indices];
CatalogOpenIndices(Num_pg_listener_indices, Name_pg_listener_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_listener_indices, lRel, rTuple);
CatalogCloseIndices(Num_pg_listener_indices, idescs);
}
}
}
}
@@ -769,6 +776,14 @@ ProcessIncomingNotify(void)
/* Rewrite the tuple with 0 in notification column */
rTuple = heap_modifytuple(lTuple, lRel, value, nulls, repl);
heap_replace(lRel, &lTuple->t_self, rTuple, NULL);
if (RelationGetForm(lRel)->relhasindex)
{
Relation idescs[Num_pg_listener_indices];
CatalogOpenIndices(Num_pg_listener_indices, Name_pg_listener_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_listener_indices, lRel, rTuple);
CatalogCloseIndices(Num_pg_listener_indices, idescs);
}
}
}
heap_endscan(sRel);

View File

@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.46 1999/11/07 23:08:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.47 1999/11/22 17:56:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -270,7 +270,7 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
FIgetnArgs(finfo) = natts;
FIgetProcOid(finfo) = Old_pg_index_Form->indproc;
pg_proc_Tuple = SearchSysCacheTuple(PROOID,
pg_proc_Tuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(Old_pg_index_Form->indproc),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.56 1999/11/07 23:08:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.57 1999/11/22 17:56:00 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -438,7 +438,7 @@ PerformAddAttribute(char *relationName,
else
attnelems = 0;
typeTuple = SearchSysCacheTuple(TYPNAME,
typeTuple = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(typename),
0, 0, 0);
tform = (Form_pg_type) GETSTRUCT(typeTuple);

View File

@@ -395,7 +395,7 @@ void CommentDatabase(char *database, char *comment) {
/*** Now, fetch user information ***/
username = GetPgUserName();
usertuple = SearchSysCacheTuple(USENAME, PointerGetDatum(username),
usertuple = SearchSysCacheTuple(USERNAME, PointerGetDatum(username),
0, 0, 0);
if (!HeapTupleIsValid(usertuple)) {
elog(ERROR, "current user '%s' does not exist", username);
@@ -454,7 +454,7 @@ void CommentRewrite(char *rule, char *comment) {
/*** Next, find the rule's oid ***/
rewritetuple = SearchSysCacheTuple(REWRITENAME, PointerGetDatum(rule),
rewritetuple = SearchSysCacheTuple(RULENAME, PointerGetDatum(rule),
0, 0, 0);
if (!HeapTupleIsValid(rewritetuple)) {
elog(ERROR, "rule '%s' does not exist", rule);
@@ -489,7 +489,7 @@ void CommentType(char *type, char *comment) {
#ifndef NO_SECURITY
user = GetPgUserName();
if (!pg_ownercheck(user, type, TYPNAME)) {
if (!pg_ownercheck(user, type, TYPENAME)) {
elog(ERROR, "you are not permitted to comment on type '%s'",
type);
}
@@ -497,7 +497,7 @@ void CommentType(char *type, char *comment) {
/*** Next, find the type's oid ***/
typetuple = SearchSysCacheTuple(TYPNAME, PointerGetDatum(type),
typetuple = SearchSysCacheTuple(TYPENAME, PointerGetDatum(type),
0, 0, 0);
if (!HeapTupleIsValid(typetuple)) {
elog(ERROR, "type '%s' does not exist", type);
@@ -604,7 +604,7 @@ void CommentProc(char *function, List *arguments, char *comment) {
if (strcmp(argument, "opaque") == 0) {
argoids[i] = 0;
} else {
argtuple = SearchSysCacheTuple(TYPNAME, PointerGetDatum(argument),
argtuple = SearchSysCacheTuple(TYPENAME, PointerGetDatum(argument),
0, 0, 0);
if (!HeapTupleIsValid(argtuple)) {
elog(ERROR, "function argument type '%s' does not exist",
@@ -627,7 +627,7 @@ void CommentProc(char *function, List *arguments, char *comment) {
/*** Now, find the corresponding oid for this procedure ***/
functuple = SearchSysCacheTuple(PRONAME, PointerGetDatum(function),
functuple = SearchSysCacheTuple(PROCNAME, PointerGetDatum(function),
Int32GetDatum(argcount),
PointerGetDatum(argoids), 0);
@@ -702,7 +702,7 @@ void CommentOperator(char *opername, List *arguments, char *comment) {
/*** Attempt to fetch the operator oid ***/
optuple = SearchSysCacheTupleCopy(OPRNAME, PointerGetDatum(opername),
optuple = SearchSysCacheTupleCopy(OPERNAME, PointerGetDatum(opername),
ObjectIdGetDatum(leftoid),
ObjectIdGetDatum(rightoid),
CharGetDatum(oprtype));
@@ -716,7 +716,7 @@ void CommentOperator(char *opername, List *arguments, char *comment) {
#ifndef NO_SECURITY
user = GetPgUserName();
if (!pg_ownercheck(user, (char *) ObjectIdGetDatum(oid), OPROID)) {
if (!pg_ownercheck(user, (char *) ObjectIdGetDatum(oid), OPEROID)) {
elog(ERROR, "you are not permitted to comment on operator '%s'",
opername);
}

View File

@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.90 1999/11/21 04:16:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.91 1999/11/22 17:56:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -938,7 +938,7 @@ GetOutputFunction(Oid type)
{
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type),
0, 0, 0);
@@ -954,7 +954,7 @@ GetTypeElement(Oid type)
{
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type),
0, 0, 0);
@@ -970,7 +970,7 @@ GetInputFunction(Oid type)
{
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type),
0, 0, 0);
@@ -986,7 +986,7 @@ IsTypeByVal(Oid type)
{
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.51 1999/11/07 23:08:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.52 1999/11/22 17:56:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -342,7 +342,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
* form name, type and constraints
*/
attributeName = NameStr(attribute->attname);
tuple = SearchSysCacheTuple(TYPOID,
tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(attribute->atttypid),
0, 0, 0);
Assert(HeapTupleIsValid(tuple));
@@ -495,6 +495,16 @@ StoreCatalogInheritance(Oid relationId, List *supers)
tuple = heap_formtuple(desc, datum, nullarr);
heap_insert(relation, tuple);
if (RelationGetForm(relation)->relhasindex)
{
Relation idescs[Num_pg_inherits_indices];
CatalogOpenIndices(Num_pg_inherits_indices, Name_pg_inherits_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_inherits_indices, relation, tuple);
CatalogCloseIndices(Num_pg_inherits_indices, idescs);
}
pfree(tuple);
seqNumber += 1;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.43 1999/10/26 03:12:34 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.44 1999/11/22 17:56:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -241,7 +241,7 @@ check_permissions(char *command,
char path[MAXPGPATH];
userName = GetPgUserName();
utup = SearchSysCacheTuple(USENAME,
utup = SearchSysCacheTuple(USERNAME,
PointerGetDatum(userName),
0, 0, 0);
Assert(utup);

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.36 1999/10/02 21:33:24 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.37 1999/11/22 17:56:01 momjian Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -269,7 +269,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
Form_pg_language languageStruct;
/* Lookup the language in the system cache */
languageTuple = SearchSysCacheTuple(LANNAME,
languageTuple = SearchSysCacheTuple(LANGNAME,
PointerGetDatum(languageName),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.13 1999/11/07 23:08:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.14 1999/11/22 17:56:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -310,7 +310,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
/* FIgetnArgs(funcInfo) = numberOfAttributes; */
FIsetnArgs(funcInfo, numberOfAttributes);
tuple = SearchSysCacheTuple(PROOID,
tuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(indproc),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -482,7 +482,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
/* we want the type so we can set the proper alignment, etc. */
if (attribute->typename == NULL)
{
tuple = SearchSysCacheTuple(TYPOID,
tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(attform->atttypid),
0, 0, 0);
if (!HeapTupleIsValid(tuple))

View File

@@ -11,6 +11,7 @@
#include "access/heapam.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_language.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_shadow.h"
@@ -75,7 +76,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
*/
case_translate_language_name(stmt->plname, languageName);
langTup = SearchSysCacheTuple(LANNAME,
langTup = SearchSysCacheTuple(LANGNAME,
PointerGetDatum(languageName),
0, 0, 0);
if (HeapTupleIsValid(langTup))
@@ -87,7 +88,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
* ----------------
*/
memset(typev, 0, sizeof(typev));
procTup = SearchSysCacheTuple(PRONAME,
procTup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(stmt->plhandler),
Int32GetDatum(0),
PointerGetDatum(typev),
@@ -127,6 +128,15 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
heap_insert(rel, tup);
if (RelationGetForm(rel)->relhasindex)
{
Relation idescs[Num_pg_language_indices];
CatalogOpenIndices(Num_pg_language_indices, Name_pg_language_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_language_indices, rel, tup);
CatalogCloseIndices(Num_pg_language_indices, idescs);
}
heap_close(rel, RowExclusiveLock);
}
@@ -161,7 +171,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
rel = heap_openr(LanguageRelationName, RowExclusiveLock);
langTup = SearchSysCacheTupleCopy(LANNAME,
langTup = SearchSysCacheTupleCopy(LANGNAME,
PointerGetDatum(languageName),
0, 0, 0);
if (!HeapTupleIsValid(langTup))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.39 1999/11/07 23:08:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.40 1999/11/22 17:56:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -78,7 +78,7 @@ RemoveOperator(char *operatorName, /* operator name */
relation = heap_openr(OperatorRelationName, RowExclusiveLock);
tup = SearchSysCacheTupleCopy(OPRNAME,
tup = SearchSysCacheTupleCopy(OPERNAME,
PointerGetDatum(operatorName),
ObjectIdGetDatum(typeId1),
ObjectIdGetDatum(typeId2),
@@ -90,7 +90,7 @@ RemoveOperator(char *operatorName, /* operator name */
userName = GetPgUserName();
if (!pg_ownercheck(userName,
(char *) ObjectIdGetDatum(tup->t_data->t_oid),
OPROID))
OPEROID))
elog(ERROR, "RemoveOperator: operator '%s': permission denied",
operatorName);
#endif
@@ -259,14 +259,14 @@ RemoveType(char *typeName) /* type name to be removed */
#ifndef NO_SECURITY
userName = GetPgUserName();
if (!pg_ownercheck(userName, typeName, TYPNAME))
if (!pg_ownercheck(userName, typeName, TYPENAME))
elog(ERROR, "RemoveType: type '%s': permission denied",
typeName);
#endif
relation = heap_openr(TypeRelationName, RowExclusiveLock);
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(typeName),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -285,7 +285,7 @@ RemoveType(char *typeName) /* type name to be removed */
/* Now, Delete the "array of" that type */
shadow_type = makeArrayTypeName(typeName);
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(shadow_type),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -331,7 +331,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
argList[i] = 0;
else
{
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(typename),
0, 0, 0);
@@ -351,7 +351,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
#endif
relation = heap_openr(ProcedureRelationName, RowExclusiveLock);
tup = SearchSysCacheTuple(PRONAME,
tup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(functionName),
Int32GetDatum(nargs),
PointerGetDatum(argList),

View File

@@ -144,7 +144,7 @@ CreateTrigger(CreateTrigStmt *stmt)
heap_endscan(tgscan);
MemSet(fargtypes, 0, 8 * sizeof(Oid));
tuple = SearchSysCacheTuple(PRONAME,
tuple = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(stmt->funcname),
Int32GetDatum(0),
PointerGetDatum(fargtypes),
@@ -161,7 +161,7 @@ CreateTrigger(CreateTrigStmt *stmt)
{
HeapTuple langTup;
langTup = SearchSysCacheTuple(LANOID,
langTup = SearchSysCacheTuple(LANGOID,
ObjectIdGetDatum(((Form_pg_proc) GETSTRUCT(tuple))->prolang),
0, 0, 0);
if (!HeapTupleIsValid(langTup))

View File

@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: user.c,v 1.36 1999/11/21 04:16:16 tgl Exp $
* $Id: user.c,v 1.37 1999/11/22 17:56:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -261,7 +261,7 @@ AlterUser(AlterUserStmt *stmt, CommandDest dest)
pg_shadow_rel = heap_openr(ShadowRelationName, AccessExclusiveLock);
pg_shadow_dsc = RelationGetDescr(pg_shadow_rel);
tuple = SearchSysCacheTuple(USENAME,
tuple = SearchSysCacheTuple(USERNAME,
PointerGetDatum(stmt->user),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -374,7 +374,7 @@ RemoveUser(char *user, CommandDest dest)
pg_shadow_rel = heap_openr(ShadowRelationName, AccessExclusiveLock);
pg_dsc = RelationGetDescr(pg_shadow_rel);
tuple = SearchSysCacheTuple(USENAME,
tuple = SearchSysCacheTuple(USERNAME,
PointerGetDatum(user),
0, 0, 0);
if (!HeapTupleIsValid(tuple))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.124 1999/11/14 17:27:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.125 1999/11/22 17:56:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -490,7 +490,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
else
stats->f_cmpgt.fn_addr = NULL;
typetuple = SearchSysCacheTuple(TYPOID,
typetuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(stats->attr->atttypid),
0, 0, 0);
if (HeapTupleIsValid(typetuple))
@@ -1976,7 +1976,7 @@ vc_scanoneind(Relation indrel, int num_tuples)
ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec);
if (nitups != num_tuples)
elog(NOTICE, "Index %s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u).\nTry recreating the index.",
elog(NOTICE, "Index %s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u).\n\tTry recreating the index.",
RelationGetRelationName(indrel), nitups, num_tuples);
} /* vc_scanoneind */
@@ -2057,7 +2057,7 @@ vc_vaconeind(VPageList vpl, Relation indrel, int num_tuples, int keep_tuples)
ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec);
if (num_index_tuples != num_tuples + keep_tuples)
elog(NOTICE, "Index %s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u).\nTry recreating the index.",
elog(NOTICE, "Index %s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u).\n\tTry recreating the index.",
RelationGetRelationName(indrel), num_index_tuples, num_tuples);
} /* vc_vaconeind */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.31 1999/10/17 18:00:29 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.32 1999/11/22 17:56:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -159,7 +159,7 @@ MJFormSkipQual(List *qualList, char *replaceopname)
* whoever marked the "=" operator mergejoinable was a loser.
* ----------------
*/
optup = SearchSysCacheTuple(OPRNAME,
optup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(replaceopname),
ObjectIdGetDatum(oprleft),
ObjectIdGetDatum(oprright),

View File

@@ -3,7 +3,7 @@
* spi.c
* Server Programming Interface
*
* $Id: spi.c,v 1.41 1999/11/07 23:08:06 momjian Exp $
* $Id: spi.c,v 1.42 1999/11/22 17:56:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -449,7 +449,7 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
return NULL;
}
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(tupdesc->attrs[fnumber - 1]->atttypid),
0, 0, 0);

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.10 1999/09/21 20:58:13 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.11 1999/11/22 17:56:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -494,7 +494,7 @@ xfunc_func_expense(LispValue node, LispValue args)
funcid = get_funcid((Func) node);
/* look up tuple in cache */
tupl = SearchSysCacheTuple(PROOID,
tupl = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
@@ -609,7 +609,7 @@ xfunc_width(LispValue clause)
else if (IsA(clause, Var))
{
/* base case: width is width of this attribute */
tupl = SearchSysCacheTuple(TYPOID,
tupl = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(get_vartype((Var) clause)),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
@@ -672,7 +672,7 @@ xfunc_width(LispValue clause)
* * get function associated with this Oper, and treat this as * a
* Func
*/
tupl = SearchSysCacheTuple(OPROID,
tupl = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(get_opno((Oper) get_op(clause))),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
@@ -1303,7 +1303,7 @@ xfunc_func_width(RegProcedure funcid, LispValue args)
/* lookup function and find its return type */
Assert(RegProcedureIsValid(funcid));
tupl = SearchSysCacheTuple(PROOID,
tupl = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
@@ -1321,7 +1321,7 @@ xfunc_func_width(RegProcedure funcid, LispValue args)
else
/* function returns a base type */
{
tupl = SearchSysCacheTuple(TYPOID,
tupl = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(proc->prorettype),
0, 0, 0);
if (!HeapTupleIsValid(tupl))

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.72 1999/09/18 19:06:54 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.73 1999/11/22 17:56:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1893,7 +1893,7 @@ prefix_quals(Var *leftop, Oid expr_op,
*/
if (pstatus == Prefix_Exact)
{
optup = SearchSysCacheTuple(OPRNAME,
optup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum("="),
ObjectIdGetDatum(datatype),
ObjectIdGetDatum(datatype),
@@ -1919,7 +1919,7 @@ prefix_quals(Var *leftop, Oid expr_op,
*
* We can always say "x >= prefix".
*/
optup = SearchSysCacheTuple(OPRNAME,
optup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(">="),
ObjectIdGetDatum(datatype),
ObjectIdGetDatum(datatype),
@@ -1947,7 +1947,7 @@ prefix_quals(Var *leftop, Oid expr_op,
prefix[prefixlen] = '\377';
prefix[prefixlen+1] = '\0';
optup = SearchSysCacheTuple(OPRNAME,
optup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum("<="),
ObjectIdGetDatum(datatype),
ObjectIdGetDatum(datatype),

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.54 1999/10/07 04:23:08 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.55 1999/11/22 17:56:17 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -902,7 +902,7 @@ eval_const_expressions_mutator (Node *node, void *context)
result_typeid = func->functype;
}
/* Someday lsyscache.c might provide a function for this */
func_tuple = SearchSysCacheTuple(PROOID,
func_tuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
if (!HeapTupleIsValid(func_tuple))

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.39 1999/11/21 23:25:47 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.40 1999/11/22 17:56:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -372,7 +372,7 @@ find_inheritance_children(Oid inhparent)
scan = heap_beginscan(relation, 0, SnapshotNow, 1, key);
while (HeapTupleIsValid(inheritsTuple = heap_getnext(scan, 0)))
{
inhrelid = ((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhrel;
inhrelid = ((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhrelid;
list = lappendi(list, inhrelid);
}
heap_endscan(scan);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.24 1999/10/02 23:29:12 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.25 1999/11/22 17:56:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -175,7 +175,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
* look for a single-argument function named with the
* target type name
*/
ftup = SearchSysCacheTuple(PRONAME,
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(typeidTypeName(func_typeids[i])),
Int32GetDatum(1),
PointerGetDatum(oid_array),

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.61 1999/11/07 23:08:10 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.62 1999/11/22 17:56:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -403,7 +403,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
* just pass through the argument itself. (make this clearer
* with some extra brackets - thomas 1998-12-05)
*/
if ((HeapTupleIsValid(tp = SearchSysCacheTuple(TYPNAME,
if ((HeapTupleIsValid(tp = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(funcname),
0, 0, 0)))
&& IS_BINARY_COMPATIBLE(typeTypeId(tp), basetype))
@@ -923,7 +923,7 @@ func_get_detail(char *funcname,
Form_pg_proc pform;
/* attempt to find with arguments exactly as specified... */
ftup = SearchSysCacheTuple(PRONAME,
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(funcname),
Int32GetDatum(nargs),
PointerGetDatum(oid_array),
@@ -953,7 +953,7 @@ func_get_detail(char *funcname,
if (ncandidates == 1)
{
*true_typeids = current_function_typeids->args;
ftup = SearchSysCacheTuple(PRONAME,
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(funcname),
Int32GetDatum(nargs),
PointerGetDatum(*true_typeids),
@@ -982,7 +982,7 @@ func_get_detail(char *funcname,
/* found something, so use the first one... */
else
{
ftup = SearchSysCacheTuple(PRONAME,
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(funcname),
Int32GetDatum(nargs),
PointerGetDatum(*true_typeids),
@@ -1111,7 +1111,7 @@ find_inheritors(Oid relid, Oid **supervec)
*/
do
{
ScanKeyEntryInitialize(&skey, 0x0, Anum_pg_inherits_inhrel,
ScanKeyEntryInitialize(&skey, 0x0, Anum_pg_inherits_inhrelid,
F_OIDEQ,
ObjectIdGetDatum(relid));

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.32 1999/11/01 05:06:21 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.33 1999/11/22 17:56:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -251,7 +251,7 @@ transformArraySubscripts(ParseState *pstate,
/* Get the type tuple for the array */
typearray = exprType(arrayBase);
type_tuple = SearchSysCacheTuple(TYPOID,
type_tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typearray),
0, 0, 0);
if (!HeapTupleIsValid(type_tuple))
@@ -265,7 +265,7 @@ transformArraySubscripts(ParseState *pstate,
type_struct_array->typname);
/* Get the type tuple for the array element type */
type_tuple = SearchSysCacheTuple(TYPOID,
type_tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typeelement),
0, 0, 0);
if (!HeapTupleIsValid(type_tuple))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.32 1999/09/18 19:07:12 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.33 1999/11/22 17:56:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -395,7 +395,7 @@ oper_exact(char *op, Oid arg1, Oid arg2)
else if ((arg2 == UNKNOWNOID) && (arg1 != InvalidOid))
arg2 = arg1;
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(arg1),
ObjectIdGetDatum(arg2),
@@ -434,7 +434,7 @@ oper_inexact(char *op, Oid arg1, Oid arg2)
/* Or found exactly one? Then proceed... */
else if (ncandidates == 1)
{
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(candidates->args[0]),
ObjectIdGetDatum(candidates->args[1]),
@@ -450,7 +450,7 @@ oper_inexact(char *op, Oid arg1, Oid arg2)
targetOids = oper_select_candidate(2, inputOids, candidates);
if (targetOids != NULL)
{
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(targetOids[0]),
ObjectIdGetDatum(targetOids[1]),
@@ -558,7 +558,7 @@ right_oper(char *op, Oid arg)
int ncandidates;
Oid *targetOid;
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(arg),
ObjectIdGetDatum(InvalidOid),
@@ -574,7 +574,7 @@ right_oper(char *op, Oid arg)
}
else if (ncandidates == 1)
{
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(candidates->args[0]),
ObjectIdGetDatum(InvalidOid),
@@ -587,7 +587,7 @@ right_oper(char *op, Oid arg)
if (targetOid != NULL)
{
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(InvalidOid),
ObjectIdGetDatum(*targetOid),
@@ -618,7 +618,7 @@ left_oper(char *op, Oid arg)
int ncandidates;
Oid *targetOid;
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(InvalidOid),
ObjectIdGetDatum(arg),
@@ -634,7 +634,7 @@ left_oper(char *op, Oid arg)
}
else if (ncandidates == 1)
{
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(InvalidOid),
ObjectIdGetDatum(candidates->args[0]),
@@ -646,7 +646,7 @@ left_oper(char *op, Oid arg)
targetOid = oper_select_candidate(1, &arg, candidates);
if (targetOid != NULL)
{
tup = SearchSysCacheTuple(OPRNAME,
tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum(op),
ObjectIdGetDatum(InvalidOid),
ObjectIdGetDatum(*targetOid),

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.48 1999/11/07 23:08:11 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.49 1999/11/22 17:56:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -329,7 +329,7 @@ SizeTargetExpr(ParseState *pstate,
oid_array[i] = InvalidOid;
/* attempt to find with arguments exactly as specified... */
ftup = SearchSysCacheTuple(PRONAME,
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum(funcname),
Int32GetDatum(2),
PointerGetDatum(oid_array),

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.26 1999/11/07 23:08:11 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.27 1999/11/22 17:56:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,7 +27,7 @@
bool
typeidIsValid(Oid id)
{
return (SearchSysCacheTuple(TYPOID,
return (SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(id),
0, 0, 0) != NULL);
}
@@ -39,7 +39,7 @@ typeidTypeName(Oid id)
HeapTuple tup;
Form_pg_type typetuple;
if (!(tup = SearchSysCacheTuple(TYPOID,
if (!(tup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(id),
0, 0, 0)))
{
@@ -56,7 +56,7 @@ typeidType(Oid id)
{
HeapTuple tup;
if (!(tup = SearchSysCacheTuple(TYPOID,
if (!(tup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(id),
0, 0, 0)))
{
@@ -75,7 +75,7 @@ typenameType(char *s)
if (s == NULL)
elog(ERROR, "type(): Null type");
if (!(tup = SearchSysCacheTuple(TYPNAME,
if (!(tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(s),
0, 0, 0)))
elog(ERROR, "Unable to locate type name '%s' in catalog", s);
@@ -154,7 +154,7 @@ typeidOutfunc(Oid type_id)
Form_pg_type type;
Oid outfunc;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type_id),
0, 0, 0);
if (!HeapTupleIsValid(typeTuple))
@@ -173,7 +173,7 @@ typeidTypeRelid(Oid type_id)
HeapTuple typeTuple;
Form_pg_type type;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(type_id),
0, 0, 0);
if (!HeapTupleIsValid(typeTuple))
@@ -212,7 +212,7 @@ GetArrayElementType(Oid typearray)
HeapTuple type_tuple;
Form_pg_type type_struct_array;
type_tuple = SearchSysCacheTuple(TYPOID,
type_tuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typearray),
0, 0, 0);

View File

@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.24 1999/11/07 23:08:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.25 1999/11/22 17:56:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -170,7 +170,7 @@ checkLockPerms(List *locks, Query *parsetree, int rt_index)
*/
rte = (RangeTblEntry *) nth(rt_index - 1, parsetree->rtable);
ev_rel = heap_openr(rte->relname, AccessShareLock);
usertup = SearchSysCacheTuple(USESYSID,
usertup = SearchSysCacheTuple(USERSYSID,
ObjectIdGetDatum(ev_rel->rd_rel->relowner),
0, 0, 0);
if (!HeapTupleIsValid(usertup))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.32 1999/11/18 13:56:27 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.33 1999/11/22 17:56:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,7 +34,7 @@ RewriteGetRuleEventRel(char *rulename)
HeapTuple htup;
Oid eventrel;
htup = SearchSysCacheTuple(REWRITENAME,
htup = SearchSysCacheTuple(RULENAME,
PointerGetDatum(rulename),
0, 0, 0);
if (!HeapTupleIsValid(htup))
@@ -83,7 +83,7 @@ RemoveRewriteRule(char *ruleName)
/*
* Scan the RuleRelation ('pg_rewrite') until we find a tuple
*/
tuple = SearchSysCacheTupleCopy(REWRITENAME,
tuple = SearchSysCacheTupleCopy(RULENAME,
PointerGetDatum(ruleName),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.37 1999/09/18 19:07:20 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.38 1999/11/22 17:56:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -42,7 +42,7 @@ RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
ruleRelation = heap_openr(RewriteRelationName, AccessShareLock);
ruleTupdesc = RelationGetDescr(ruleRelation);
ruletuple = SearchSysCacheTuple(RULOID,
ruletuple = SearchSysCacheTuple(RULEOID,
ObjectIdGetDatum(ruleoid),
0, 0, 0);
if (ruletuple == NULL)
@@ -81,7 +81,7 @@ IsDefinedRewriteRule(char *ruleName)
{
HeapTuple tuple;
tuple = SearchSysCacheTuple(REWRITENAME,
tuple = SearchSysCacheTuple(RULENAME,
PointerGetDatum(ruleName),
0, 0, 0);
return HeapTupleIsValid(tuple);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.30 1999/07/22 02:40:07 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.31 1999/11/22 17:56:26 momjian Exp $
*
* NOTES
* This cruft is the server side of PQfn.
@@ -202,7 +202,7 @@ update_fp_info(Oid func_id, struct fp_info * fip)
MemSet((char *) fip, 0, (int) sizeof(struct fp_info));
fip->funcid = InvalidOid;
func_htp = SearchSysCacheTuple(PROOID,
func_htp = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(func_id),
0, 0, 0);
if (!HeapTupleIsValid(func_htp))
@@ -219,7 +219,7 @@ update_fp_info(Oid func_id, struct fp_info * fip)
{
if (OidIsValid(argtypes[i]))
{
type_htp = SearchSysCacheTuple(TYPOID,
type_htp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(argtypes[i]),
0, 0, 0);
if (!HeapTupleIsValid(type_htp))
@@ -235,7 +235,7 @@ update_fp_info(Oid func_id, struct fp_info * fip)
if (OidIsValid(rettype))
{
type_htp = SearchSysCacheTuple(TYPOID,
type_htp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(rettype),
0, 0, 0);
if (!HeapTupleIsValid(type_htp))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.41 1999/10/18 03:32:29 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.42 1999/11/22 17:56:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -170,7 +170,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
switch (aip->ai_idtype)
{
case ACL_IDTYPE_UID:
htup = SearchSysCacheTuple(USENAME,
htup = SearchSysCacheTuple(USERNAME,
PointerGetDatum(name),
0, 0, 0);
if (!HeapTupleIsValid(htup))
@@ -281,7 +281,7 @@ aclitemout(AclItem *aip)
switch (aip->ai_idtype)
{
case ACL_IDTYPE_UID:
htup = SearchSysCacheTuple(USESYSID,
htup = SearchSysCacheTuple(USERSYSID,
ObjectIdGetDatum(aip->ai_id),
0, 0, 0);
if (!HeapTupleIsValid(htup))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.48 1999/07/19 07:07:25 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.49 1999/11/22 17:56:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1470,7 +1470,7 @@ system_cache_lookup(Oid element_type,
HeapTuple typeTuple;
Form_pg_type typeStruct;
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(element_type),
0, 0, 0);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.44 1999/11/07 23:08:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.45 1999/11/22 17:56:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,7 +54,7 @@ regprocin(char *pro_name_or_oid)
if (pro_name_or_oid[0] >= '0' &&
pro_name_or_oid[0] <= '9')
{
proctup = SearchSysCacheTuple(PROOID,
proctup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(oidin(pro_name_or_oid)),
0, 0, 0);
if (HeapTupleIsValid(proctup))
@@ -165,7 +165,7 @@ regprocout(RegProcedure proid)
if (!IsBootstrapProcessingMode())
{
proctup = SearchSysCacheTuple(PROOID,
proctup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(proid),
0, 0, 0);
@@ -254,7 +254,7 @@ oid8types(Oid *oidArray)
{
if (*sp != InvalidOid)
{
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(*sp),
0, 0, 0);
if (HeapTupleIsValid(typetup))

View File

@@ -6,7 +6,7 @@
*
* 1999 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.2 1999/10/08 12:00:08 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.3 1999/11/22 17:56:29 momjian Exp $
*
* ----------
*/
@@ -1073,7 +1073,7 @@ ri_AttributesEqual(Oid typeid, Datum oldvalue, Datum newvalue)
elog(FATAL, "error in RI operator cache");
/* ----------
* If not found, lookup the OPRNAME system cache for it
* If not found, lookup the OPERNAME system cache for it
* and remember that info.
* ----------
*/
@@ -1082,7 +1082,7 @@ ri_AttributesEqual(Oid typeid, Datum oldvalue, Datum newvalue)
HeapTuple opr_tup;
Form_pg_operator opr_struct;
opr_tup = SearchSysCacheTuple(OPRNAME,
opr_tup = SearchSysCacheTuple(OPERNAME,
PointerGetDatum("="),
ObjectIdGetDatum(typeid),
ObjectIdGetDatum(typeid),

View File

@@ -3,7 +3,7 @@
* out of it's tuple
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.31 1999/11/15 02:00:05 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.32 1999/11/22 17:56:30 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -484,7 +484,7 @@ pg_get_indexdef(Oid indexrelid)
HeapTuple proctup;
Form_pg_proc procStruct;
proctup = SearchSysCacheTuple(PROOID,
proctup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(idxrec->indproc), 0, 0, 0);
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup for proc %u failed", idxrec->indproc);
@@ -567,7 +567,7 @@ pg_get_userbyid(int32 uid)
* Get the pg_shadow entry and print the result
* ----------
*/
usertup = SearchSysCacheTuple(USESYSID,
usertup = SearchSysCacheTuple(USERSYSID,
ObjectIdGetDatum(uid), 0, 0, 0);
if (HeapTupleIsValid(usertup))
{
@@ -1282,7 +1282,7 @@ get_rule_expr(Node *node, deparse_context *context)
HeapTuple tp;
Form_pg_operator optup;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
Assert(HeapTupleIsValid(tp));
@@ -1439,7 +1439,7 @@ get_func_expr(Expr *expr, deparse_context *context)
* Get the functions pg_proc tuple
* ----------
*/
proctup = SearchSysCacheTuple(PROOID,
proctup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(func->funcid),
0, 0, 0);
if (!HeapTupleIsValid(proctup))
@@ -1524,7 +1524,7 @@ get_tle_expr(TargetEntry *tle, deparse_context *context)
* Get the functions pg_proc tuple
* ----------
*/
tup = SearchSysCacheTuple(PROOID,
tup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(func->funcid), 0, 0, 0);
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup for proc %u failed", func->funcid);
@@ -1548,7 +1548,7 @@ get_tle_expr(TargetEntry *tle, deparse_context *context)
* Furthermore, the name of the function must be the same
* as the argument/result type name.
*/
tup = SearchSysCacheTuple(TYPOID,
tup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procStruct->prorettype),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -1607,7 +1607,7 @@ get_const_expr(Const *constval, deparse_context *context)
return;
}
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(constval->consttype),
0, 0, 0);
if (!HeapTupleIsValid(typetup))

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.41 1999/09/18 19:07:49 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.42 1999/11/22 17:56:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -510,7 +510,7 @@ convert_to_scale(Datum value, Oid typid,
MemSet(oid_array, 0, MAXFARGS * sizeof(Oid));
oid_array[0] = typid;
ftup = SearchSysCacheTuple(PRONAME,
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum("float8"),
Int32GetDatum(1),
PointerGetDatum(oid_array),
@@ -622,7 +622,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
*commonfrac = ((Form_pg_statistic) GETSTRUCT(tuple))->stacommonfrac;
/* Get the type input proc for the column datatype */
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (! HeapTupleIsValid(typeTuple))

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.26 1999/09/18 19:07:49 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.27 1999/11/22 17:56:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -72,7 +72,7 @@ SetDefine(char *querystr, char *typename)
* until you start the next command.)
*/
CommandCounterIncrement();
tup = SearchSysCacheTuple(PROOID,
tup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(setoid),
0, 0, 0);
if (!HeapTupleIsValid(tup))
@@ -102,7 +102,7 @@ SetDefine(char *querystr, char *typename)
/* change the pg_proc tuple */
procrel = heap_openr(ProcedureRelationName, RowExclusiveLock);
tup = SearchSysCacheTuple(PROOID,
tup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(setoid),
0, 0, 0);
if (HeapTupleIsValid(tup))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.53 1999/11/21 01:58:22 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.54 1999/11/22 17:56:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#include "access/genam.h"
#include "access/heapam.h"
#include "access/valid.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
@@ -711,7 +712,6 @@ InitSysCache(char *relname,
* ----------------
*/
{
/*
* We can only do this optimization because the number of hash
* buckets never changes. Without it, we call malloc() too much.
@@ -811,9 +811,10 @@ InitSysCache(char *relname,
/* --------------------------------
* SearchSelfReferences
*
* This call searches a self referencing information,
*
* which causes a cycle in system catalog cache
* This call searches for self-referencing information,
* which causes infinite recursion in the system catalog cache.
* This code short-circuits the normal index lookup for cache loads
* in those cases and replaces it with a heap scan.
*
* cache should already be initailized
* --------------------------------
@@ -823,45 +824,81 @@ SearchSelfReferences(struct catcache * cache)
{
HeapTuple ntp;
Relation rel;
static Oid indexSelfOid = 0;
static HeapTuple indexSelfTuple = 0;
if (cache->id != INDEXRELID)
if (cache->id == INDEXRELID)
{
static Oid indexSelfOid = InvalidOid;
static HeapTuple indexSelfTuple = NULL;
if (!OidIsValid(indexSelfOid))
{
/* Find oid of pg_index_indexrelid_index */
rel = heap_openr(RelationRelationName, AccessShareLock);
ntp = ClassNameIndexScan(rel, IndexRelidIndex);
if (!HeapTupleIsValid(ntp))
elog(ERROR, "SearchSelfReferences: %s not found in %s",
IndexRelidIndex, RelationRelationName);
indexSelfOid = ntp->t_data->t_oid;
pfree(ntp);
heap_close(rel, AccessShareLock);
}
/* Looking for something other than pg_index_indexrelid_index? */
if ((Oid)cache->cc_skey[0].sk_argument != indexSelfOid)
return (HeapTuple)0;
/* Do we need to load our private copy of the tuple? */
if (!HeapTupleIsValid(indexSelfTuple))
{
HeapScanDesc sd;
MemoryContext oldcxt;
if (!CacheCxt)
CacheCxt = CreateGlobalMemory("Cache");
rel = heap_open(cache->relationId, AccessShareLock);
sd = heap_beginscan(rel, false, SnapshotNow, 1, cache->cc_skey);
ntp = heap_getnext(sd, 0);
if (!HeapTupleIsValid(ntp))
elog(ERROR, "SearchSelfReferences: tuple not found");
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
indexSelfTuple = heap_copytuple(ntp);
MemoryContextSwitchTo(oldcxt);
heap_endscan(sd);
heap_close(rel, AccessShareLock);
}
return indexSelfTuple;
}
else if (cache->id == OPEROID)
{
/* bootstrapping this requires preloading a range of rows. bjm */
static HeapTuple operatorSelfTuple[MAX_OIDCMP-MIN_OIDCMP+1];
Oid lookup_oid = (Oid)cache->cc_skey[0].sk_argument;
if (lookup_oid < MIN_OIDCMP || lookup_oid > MAX_OIDCMP)
return (HeapTuple)0;
if (!HeapTupleIsValid(operatorSelfTuple[lookup_oid-MIN_OIDCMP]))
{
HeapScanDesc sd;
MemoryContext oldcxt;
if (!CacheCxt)
CacheCxt = CreateGlobalMemory("Cache");
rel = heap_open(cache->relationId, AccessShareLock);
sd = heap_beginscan(rel, false, SnapshotNow, 1, cache->cc_skey);
ntp = heap_getnext(sd, 0);
if (!HeapTupleIsValid(ntp))
elog(ERROR, "SearchSelfReferences: tuple not found");
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
operatorSelfTuple[lookup_oid-MIN_OIDCMP] = heap_copytuple(ntp);
MemoryContextSwitchTo(oldcxt);
heap_endscan(sd);
heap_close(rel, AccessShareLock);
}
return operatorSelfTuple[lookup_oid-MIN_OIDCMP];
}
else
return (HeapTuple)0;
if (!indexSelfOid)
{
rel = heap_openr(RelationRelationName, AccessShareLock);
ntp = ClassNameIndexScan(rel, IndexRelidIndex);
if (!HeapTupleIsValid(ntp))
elog(ERROR, "SearchSelfRefernces: %s not found in %s",
IndexRelidIndex, RelationRelationName);
indexSelfOid = ntp->t_data->t_oid;
pfree(ntp);
heap_close(rel, AccessShareLock);
}
if ((Oid)cache->cc_skey[0].sk_argument != indexSelfOid)
return (HeapTuple)0;
if (!indexSelfTuple)
{
HeapScanDesc sd;
MemoryContext oldcxt;
if (!CacheCxt)
CacheCxt = CreateGlobalMemory("Cache");
rel = heap_open(cache->relationId, AccessShareLock);
sd = heap_beginscan(rel, false, SnapshotNow, 1, cache->cc_skey);
ntp = heap_getnext(sd, 0);
if (!HeapTupleIsValid(ntp))
elog(ERROR, "SearchSelfRefernces: tuple not found");
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
indexSelfTuple = heap_copytuple(ntp);
MemoryContextSwitchTo(oldcxt);
heap_endscan(sd);
heap_close(rel, AccessShareLock);
}
return indexSelfTuple;
}
/* --------------------------------
@@ -907,10 +944,8 @@ SearchSysCache(struct catcache * cache,
/*
* resolve self referencing informtion
*/
if (ntp = SearchSelfReferences(cache), ntp)
{
return heap_copytuple(ntp);
}
if ((ntp = SearchSelfReferences(cache)))
return heap_copytuple(ntp);
/* ----------------
* find the hash bucket in which to look for the tuple

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.26 1999/07/17 20:18:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.27 1999/11/22 17:56:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,7 +53,7 @@ GetDynamicFuncArgType(Var *arg, ExprContext *econtext)
relname = (char *) getrelname(rtid, econtext->ecxt_range_table);
tup = SearchSysCacheTuple(TYPNAME,
tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(relname),
0, 0, 0);
if (!tup)
@@ -89,7 +89,7 @@ init_fcache(Oid foid,
if (!use_syscache)
elog(ERROR, "what the ????, init the fcache without the catalogs?");
procedureTuple = SearchSysCacheTuple(PROOID,
procedureTuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(foid),
0, 0, 0);
@@ -110,7 +110,7 @@ init_fcache(Oid foid,
* to "null" so we just return it.
* ----------------
*/
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procedureStruct->prorettype),
0, 0, 0);
@@ -255,7 +255,7 @@ init_fcache(Oid foid,
else
{
tmp = (text *)
SearchSysCacheGetAttribute(PROOID,
SearchSysCacheGetAttribute(PROCOID,
Anum_pg_proc_probin,
ObjectIdGetDatum(foid),
0, 0, 0);

View File

@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.35 1999/11/07 23:08:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.36 1999/11/22 17:56:32 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -263,7 +263,7 @@ get_opcode(Oid opno)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -286,7 +286,7 @@ get_opname(Oid opno)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -310,7 +310,7 @@ op_mergejoinable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -342,7 +342,7 @@ op_hashjoinable(Oid opno, Oid ltype, Oid rtype)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -362,7 +362,7 @@ get_operator_tuple(Oid opno)
{
HeapTuple optup;
if ((optup = SearchSysCacheTuple(OPROID,
if ((optup = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0)))
return optup;
@@ -381,7 +381,7 @@ get_commutator(Oid opno)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -404,7 +404,7 @@ get_negator(Oid opno)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -427,7 +427,7 @@ get_oprrest(Oid opno)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -450,7 +450,7 @@ get_oprjoin(Oid opno)
{
HeapTuple tp;
tp = SearchSysCacheTuple(OPROID,
tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -474,7 +474,7 @@ get_func_rettype(Oid funcid)
HeapTuple func_tuple;
Oid funcrettype;
func_tuple = SearchSysCacheTuple(PROOID,
func_tuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
@@ -548,7 +548,7 @@ get_typlen(Oid typid)
{
HeapTuple tp;
tp = SearchSysCacheTuple(TYPOID,
tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -572,7 +572,7 @@ get_typbyval(Oid typid)
{
HeapTuple tp;
tp = SearchSysCacheTuple(TYPOID,
tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -590,7 +590,7 @@ get_typalign(Oid typid)
{
HeapTuple tp;
tp = SearchSysCacheTuple(TYPOID,
tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -628,7 +628,7 @@ get_typdefault(Oid typid)
* First, see if there is a non-null typdefault field (usually there isn't)
*/
typDefault = (struct varlena *)
SearchSysCacheGetAttribute(TYPOID,
SearchSysCacheGetAttribute(TYPEOID,
Anum_pg_type_typdefault,
ObjectIdGetDatum(typid),
0, 0, 0);
@@ -645,7 +645,7 @@ get_typdefault(Oid typid)
* just did --- but at present this path isn't taken often enough to
* make it worth fixing.
*/
typeTuple = SearchSysCacheTuple(TYPOID,
typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
@@ -727,7 +727,7 @@ get_typtype(Oid typid)
{
HeapTuple tp;
tp = SearchSysCacheTuple(TYPOID,
tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.80 1999/11/21 01:58:22 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.81 1999/11/22 17:56:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -524,7 +524,7 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo,
for (i = 1; i <= relation->rd_rel->relnatts; i++)
{
atttup = (HeapTuple) AttributeNumIndexScan(attrel,
atttup = (HeapTuple) AttributeRelidNumIndexScan(attrel,
RelationGetRelid(relation), i);
if (!HeapTupleIsValid(atttup))
@@ -2085,7 +2085,7 @@ write_irels(void)
SetProcessingMode(BootstrapProcessing);
bi.infotype = INFO_RELNAME;
bi.i.info_name = AttributeNumIndex;
bi.i.info_name = AttributeRelidNumIndex;
irel[0] = RelationBuildDesc(bi, NULL);
irel[0]->rd_isnailed = true;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.40 1999/11/18 13:56:29 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.41 1999/11/22 17:56:32 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -45,12 +45,63 @@ extern bool AMI_OVERRIDE; /* XXX style */
typedef HeapTuple (*ScanFunc) ();
/* ----------------
* Warning: cacheinfo[] below is changed, then be sure and
* update the magic constants in syscache.h!
* ----------------
*/
/*---------------------------------------------------------------------------
Adding system caches:
Add your new cache to the list in include/utils/syscache.h. Keep
the list sorted alphabetically and adjust the cache numbers
accordingly.
Add your entry to the cacheinfo[] array below. All cache lists are
alphabetical, so add it in the proper place. Specify the relation
name, number of arguments, argument names, size of tuple, index lookup
function, and index name.
In include/catalog/indexing.h, add a define for the number of indexes
in the relation, add a define for the index name, add an extern
array to hold the index names, define the index lookup function
prototype, and use DECLARE_UNIQUE_INDEX to define the index. Cache
lookups return only one row, so the index should be unique.
In backend/catalog/indexing.c, initialize the relation array with
the index names for the relation, and create the index lookup function.
Pick one that takes similar arguments and use that one, but keep the
function names in the same order as the cache list for clarity.
Finally, any place your relation gets heap_insert() or
heap_replace calls, include code to do a CatalogIndexInsert() to update
the system indexes. The heap_* calls do not update indexes.
bjm 1999/11/22
---------------------------------------------------------------------------
*/
static struct cachedesc cacheinfo[] = {
{AggregateRelationName, /* AGGNAME */
2,
{
Anum_pg_aggregate_aggname,
Anum_pg_aggregate_aggbasetype,
0,
0
},
offsetof(FormData_pg_aggregate, agginitval1),
AggregateNameTypeIndex,
AggregateNameTypeIndexScan},
{AccessMethodRelationName, /* AMNAME */
1,
{
Anum_pg_am_amname,
0,
0,
0
},
sizeof(FormData_pg_am),
AmNameIndex,
AmNameIndexScan},
{AccessMethodOperatorRelationName, /* AMOPOPID */
3,
{
@@ -61,7 +112,7 @@ static struct cachedesc cacheinfo[] = {
},
sizeof(FormData_pg_amop),
AccessMethodOpidIndex,
(ScanFunc) AccessMethodOpidIndexScan},
AccessMethodOpidIndexScan},
{AccessMethodOperatorRelationName, /* AMOPSTRATEGY */
3,
{
@@ -82,8 +133,8 @@ static struct cachedesc cacheinfo[] = {
0
},
ATTRIBUTE_TUPLE_SIZE,
AttributeNameIndex,
(ScanFunc) AttributeNameIndexScan},
AttributeRelidNameIndex,
AttributeRelidNameIndexScan},
{AttributeRelationName, /* ATTNUM */
2,
{
@@ -93,8 +144,52 @@ static struct cachedesc cacheinfo[] = {
0
},
ATTRIBUTE_TUPLE_SIZE,
AttributeNumIndex,
(ScanFunc) AttributeNumIndexScan},
AttributeRelidNumIndex,
(ScanFunc) AttributeRelidNumIndexScan},
{OperatorClassRelationName, /* CLADEFTYPE */
1,
{
Anum_pg_opclass_opcdeftype,
0,
0,
0
},
sizeof(FormData_pg_opclass),
OpclassDeftypeIndex,
OpclassDeftypeIndexScan},
{OperatorClassRelationName, /* CLANAME */
1,
{
Anum_pg_opclass_opcname,
0,
0,
0
},
sizeof(FormData_pg_opclass),
OpclassNameIndex,
OpclassNameIndexScan},
{GroupRelationName, /* GRONAME */
1,
{
Anum_pg_group_groname,
0,
0,
0
},
offsetof(FormData_pg_group, grolist[0]),
GroupNameIndex,
GroupNameIndexScan},
{GroupRelationName, /* GROSYSID */
1,
{
Anum_pg_group_grosysid,
0,
0,
0
},
offsetof(FormData_pg_group, grolist[0]),
GroupSysidIndex,
GroupSysidIndexScan},
{IndexRelationName, /* INDEXRELID */
1,
{
@@ -105,8 +200,19 @@ static struct cachedesc cacheinfo[] = {
},
offsetof(FormData_pg_index, indpred),
IndexRelidIndex,
(ScanFunc) IndexRelidIndexScan},
{LanguageRelationName, /* LANNAME */
IndexRelidIndexScan},
{InheritsRelationName, /* INHRELID */
2,
{
Anum_pg_inherits_inhrelid,
Anum_pg_inherits_inhseqno,
0,
0
},
sizeof(FormData_pg_inherits),
InheritsRelidSeqnoIndex,
InheritsRelidSeqnoIndexScan},
{LanguageRelationName, /* LANGNAME */
1,
{
Anum_pg_language_lanname,
@@ -115,9 +221,31 @@ static struct cachedesc cacheinfo[] = {
0
},
offsetof(FormData_pg_language, lancompiler),
NULL,
NULL},
{OperatorRelationName, /* OPRNAME */
LanguageNameIndex,
LanguageNameIndexScan},
{LanguageRelationName, /* LANGOID */
1,
{
ObjectIdAttributeNumber,
0,
0,
0
},
offsetof(FormData_pg_language, lancompiler),
LanguageOidIndex,
LanguageOidIndexScan},
{ListenerRelationName, /* LISTENREL */
2,
{
Anum_pg_listener_relname,
Anum_pg_listener_pid,
0,
0
},
sizeof(FormData_pg_listener),
ListenerRelnamePidIndex,
ListenerRelnamePidIndexScan},
{OperatorRelationName, /* OPERNAME */
4,
{
Anum_pg_operator_oprname,
@@ -126,9 +254,9 @@ static struct cachedesc cacheinfo[] = {
Anum_pg_operator_oprkind
},
sizeof(FormData_pg_operator),
NULL,
NULL},
{OperatorRelationName, /* OPROID */
OperatorNameIndex,
(ScanFunc) OperatorNameIndexScan},
{OperatorRelationName, /* OPEROID */
1,
{
ObjectIdAttributeNumber,
@@ -137,9 +265,9 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_operator),
NULL,
(ScanFunc) NULL},
{ProcedureRelationName, /* PRONAME */
OperatorOidIndex,
OperatorOidIndexScan},
{ProcedureRelationName, /* PROCNAME */
3,
{
Anum_pg_proc_proname,
@@ -150,7 +278,7 @@ static struct cachedesc cacheinfo[] = {
offsetof(FormData_pg_proc, prosrc),
ProcedureNameIndex,
(ScanFunc) ProcedureNameIndexScan},
{ProcedureRelationName, /* PROOID */
{ProcedureRelationName, /* PROCOID */
1,
{
ObjectIdAttributeNumber,
@@ -160,7 +288,7 @@ static struct cachedesc cacheinfo[] = {
},
offsetof(FormData_pg_proc, prosrc),
ProcedureOidIndex,
(ScanFunc) ProcedureOidIndexScan},
ProcedureOidIndexScan},
{RelationRelationName, /* RELNAME */
1,
{
@@ -171,7 +299,7 @@ static struct cachedesc cacheinfo[] = {
},
CLASS_TUPLE_SIZE,
ClassNameIndex,
(ScanFunc) ClassNameIndexScan},
ClassNameIndexScan},
{RelationRelationName, /* RELOID */
1,
{
@@ -182,8 +310,30 @@ static struct cachedesc cacheinfo[] = {
},
CLASS_TUPLE_SIZE,
ClassOidIndex,
(ScanFunc) ClassOidIndexScan},
{TypeRelationName, /* TYPNAME */
ClassOidIndexScan},
{RewriteRelationName, /* REWRITENAME */
1,
{
Anum_pg_rewrite_rulename,
0,
0,
0
},
offsetof(FormData_pg_rewrite, ev_qual),
RewriteRulenameIndex,
RewriteRulenameIndexScan},
{RewriteRelationName, /* RULEOID */
1,
{
ObjectIdAttributeNumber,
0,
0,
0
},
offsetof(FormData_pg_rewrite, ev_qual),
RewriteOidIndex,
RewriteOidIndexScan},
{TypeRelationName, /* TYPENAME */
1,
{
Anum_pg_type_typname,
@@ -194,7 +344,7 @@ static struct cachedesc cacheinfo[] = {
offsetof(FormData_pg_type, typalign) +sizeof(char),
TypeNameIndex,
TypeNameIndexScan},
{TypeRelationName, /* TYPOID */
{TypeRelationName, /* TYPEOID */
1,
{
ObjectIdAttributeNumber,
@@ -205,73 +355,7 @@ static struct cachedesc cacheinfo[] = {
offsetof(FormData_pg_type, typalign) +sizeof(char),
TypeOidIndex,
TypeOidIndexScan},
{AccessMethodRelationName, /* AMNAME */
1,
{
Anum_pg_am_amname,
0,
0,
0
},
sizeof(FormData_pg_am),
NULL,
NULL},
{OperatorClassRelationName, /* CLANAME */
1,
{
Anum_pg_opclass_opcname,
0,
0,
0
},
sizeof(FormData_pg_opclass),
NULL,
NULL},
{InheritsRelationName, /* INHRELID */
2,
{
Anum_pg_inherits_inhrel,
Anum_pg_inherits_inhseqno,
0,
0
},
sizeof(FormData_pg_inherits),
NULL,
(ScanFunc) NULL},
{RewriteRelationName, /* RULOID */
1,
{
ObjectIdAttributeNumber,
0,
0,
0
},
offsetof(FormData_pg_rewrite, ev_qual),
NULL,
(ScanFunc) NULL},
{AggregateRelationName, /* AGGNAME */
2,
{
Anum_pg_aggregate_aggname,
Anum_pg_aggregate_aggbasetype,
0,
0
},
offsetof(FormData_pg_aggregate, agginitval1),
NULL,
(ScanFunc) NULL},
{ListenerRelationName, /* LISTENREL */
2,
{
Anum_pg_listener_relname,
Anum_pg_listener_pid,
0,
0
},
sizeof(FormData_pg_listener),
NULL,
(ScanFunc) NULL},
{ShadowRelationName, /* USENAME */
{ShadowRelationName, /* USERNAME */
1,
{
Anum_pg_shadow_usename,
@@ -280,9 +364,10 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_shadow),
NULL,
(ScanFunc) NULL},
{ShadowRelationName, /* USESYSID */
NULL,NULL
/* ShadowNameIndex,
ShadowNameIndexScan*/},
{ShadowRelationName, /* USERSYSID */
1,
{
Anum_pg_shadow_usesysid,
@@ -291,63 +376,9 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_shadow),
NULL,
(ScanFunc) NULL},
{GroupRelationName, /* GRONAME */
1,
{
Anum_pg_group_groname,
0,
0,
0
},
offsetof(FormData_pg_group, grolist[0]),
NULL,
(ScanFunc) NULL},
{GroupRelationName, /* GROSYSID */
1,
{
Anum_pg_group_grosysid,
0,
0,
0
},
offsetof(FormData_pg_group, grolist[0]),
NULL,
(ScanFunc) NULL},
{RewriteRelationName, /* REWRITENAME */
1,
{
Anum_pg_rewrite_rulename,
0,
0,
0
},
offsetof(FormData_pg_rewrite, ev_qual),
NULL,
(ScanFunc) NULL},
{OperatorClassRelationName, /* CLADEFTYPE */
1,
{
Anum_pg_opclass_opcdeftype,
0,
0,
0
},
sizeof(FormData_pg_opclass),
NULL,
(ScanFunc) NULL},
{LanguageRelationName, /* LANOID */
1,
{
ObjectIdAttributeNumber,
0,
0,
0
},
offsetof(FormData_pg_language, lancompiler),
NULL,
NULL}
NULL,NULL
/* ShadowSysidIndex,
ShadowSysidIndexScan*/}
};
static struct catcache *SysCache[lengthof(cacheinfo)];

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.36 1999/11/07 23:08:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.37 1999/11/22 17:56:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -67,7 +67,7 @@ fmgr_dynamic(Oid procedureId, int *pronargs)
*/
rel = heap_openr(ProcedureRelationName, AccessShareLock);
procedureTuple = SearchSysCacheTuple(PROOID,
procedureTuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(procedureId),
0, 0, 0);
if (!HeapTupleIsValid(procedureTuple))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.32 1999/07/17 20:18:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.33 1999/11/22 17:56:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -217,7 +217,7 @@ fmgr_info(Oid procedureId, FmgrInfo *finfo)
}
else
{
procedureTuple = SearchSysCacheTuple(PROOID,
procedureTuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(procedureId),
0, 0, 0);
if (!HeapTupleIsValid(procedureTuple))
@@ -270,7 +270,7 @@ fmgr_info(Oid procedureId, FmgrInfo *finfo)
* this is the case, we return a NULL function pointer and
* the number of arguments from the procedure.
*/
languageTuple = SearchSysCacheTuple(LANOID,
languageTuple = SearchSysCacheTuple(LANGOID,
ObjectIdGetDatum(procedureStruct->prolang),
0, 0, 0);
if (!HeapTupleIsValid(languageTuple))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.35 1999/10/06 21:58:10 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.36 1999/11/22 17:56:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -453,7 +453,7 @@ SetUserId()
}
userName = GetPgUserName();
userTup = SearchSysCacheTuple(USENAME,
userTup = SearchSysCacheTuple(USERNAME,
PointerGetDatum(userName),
0, 0, 0);
if (!HeapTupleIsValid(userTup))

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.10 1999/07/16 05:23:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.11 1999/11/22 17:56:35 momjian Exp $
*
* DESCRIPTION
* See superuser().
@@ -30,7 +30,7 @@ superuser(void)
HeapTuple utup;
utup = SearchSysCacheTuple(USENAME,
utup = SearchSysCacheTuple(USERNAME,
PointerGetDatum(UserName),
0, 0, 0);
Assert(utup != NULL);