Commit fc955b14 authored by Bruce Momjian's avatar Bruce Momjian

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.
parent e30c2d67
......@@ -351,7 +351,7 @@
<synopsis>
int PgConnection::ExecTuplesOk(const char *query)
</synopsis>
Returns TRUE if the command query succeeds and there are tuples to be retrieved.
Returns TRUE if the command query succeeds.
</para>
</listitem>
<listitem>
......
......@@ -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);
......
......@@ -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))
......
......@@ -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);
}
......
......@@ -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 */
......
......@@ -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
......
......@@ -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))
......
......@@ -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))
......
......@@ -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");
......
......@@ -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)),
......
This diff is collapsed.
......@@ -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))
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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))
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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))
......
......@@ -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))
......
......@@ -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),
......
......@@ -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))
......
......@@ -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))
......
......@@ -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 */
......
......@@ -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),
......
......@@ -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);
......
......@@ -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))
......
......@@ -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),
......
......@@ -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))
......
......@@ -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);
......
......@@ -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),
......
......@@ -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));
......
......@@ -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))
......
......@@ -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),
......
......@@ -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),
......
......@@ -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);
......
......@@ -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))
......
......@@ -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);
......
......@@ -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);
......
......@@ -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))
......
......@@ -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))
......
......@@ -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);
......
......@@ -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))
......
......@@ -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),
......
......@@ -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))
......
......@@ -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))
......
......@@ -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))
......
......@@ -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)
return (HeapTuple)0;
if (!indexSelfOid)
if (cache->id == INDEXRELID)
{
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);
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;
}
if ((Oid)cache->cc_skey[0].sk_argument != indexSelfOid)
return (HeapTuple)0;
if (!indexSelfTuple)
else if (cache->id == OPEROID)
{
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);
/* 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;
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
......
......@@ -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);
......
......@@ -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))
......
......@@ -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;
......
This diff is collapsed.
......@@ -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))
......
......@@ -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))
......
......@@ -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))
......
......@@ -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);
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.34 1999/10/23 03:13:26 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.35 1999/11/22 17:56:36 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
......@@ -118,7 +118,7 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
numParents = 0;
for (i = 0; i < numInherits; i++)
{
if (strcmp(inhinfo[i].inhrel, oid) == 0)
if (strcmp(inhinfo[i].inhrelid, oid) == 0)
numParents++;
}
......@@ -130,7 +130,7 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
j = 0;
for (i = 0; i < numInherits; i++)
{
if (strcmp(inhinfo[i].inhrel, oid) == 0)
if (strcmp(inhinfo[i].inhrelid, oid) == 0)
{
parentInd = findTableByOid(tblinfo, numTables,
inhinfo[i].inhparent);
......
......@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.123 1999/10/23 03:13:26 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.124 1999/11/22 17:56:36 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
......@@ -1096,8 +1096,8 @@ clearInhInfo(InhInfo *inh, int numInherits)
return;
for (i = 0; i < numInherits; ++i)
{
if (inh[i].inhrel)
free(inh[i].inhrel);
if (inh[i].inhrelid)
free(inh[i].inhrelid);
if (inh[i].inhparent)
free(inh[i].inhparent);
}
......@@ -1478,7 +1478,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
sprintf(query, "SELECT rcname from pg_relcheck, pg_inherits as i "
"where rcrelid = '%s'::oid "
" and rcrelid = i.inhrel"
" and rcrelid = i.inhrelid"
" and exists "
" (select * from pg_relcheck as c "
" where c.rcname = pg_relcheck.rcname "
......@@ -1523,7 +1523,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
"where rcrelid = '%s'::oid "
" and not exists "
" (select * from pg_relcheck as c, pg_inherits as i "
" where i.inhrel = pg_relcheck.rcrelid "
" where i.inhrelid = pg_relcheck.rcrelid "
" and c.rcname = pg_relcheck.rcname "
" and c.rcsrc = pg_relcheck.rcsrc "
" and c.rcrelid = i.inhparent) ",
......@@ -1738,12 +1738,12 @@ getInherits(int *numInherits)
char query[MAX_QUERY_SIZE];
InhInfo *inhinfo;
int i_inhrel;
int i_inhrelid;
int i_inhparent;
/* find all the inheritance information */
sprintf(query, "SELECT inhrel, inhparent from pg_inherits");
sprintf(query, "SELECT inhrelid, inhparent from pg_inherits");
res = PQexec(g_conn, query);
if (!res ||
......@@ -1759,12 +1759,12 @@ getInherits(int *numInherits)
inhinfo = (InhInfo *) malloc(ntups * sizeof(InhInfo));
i_inhrel = PQfnumber(res, "inhrel");
i_inhrelid = PQfnumber(res, "inhrelid");
i_inhparent = PQfnumber(res, "inhparent");
for (i = 0; i < ntups; i++)
{
inhinfo[i].inhrel = strdup(PQgetvalue(res, i, i_inhrel));
inhinfo[i].inhrelid = strdup(PQgetvalue(res, i, i_inhrelid));
inhinfo[i].inhparent = strdup(PQgetvalue(res, i, i_inhparent));
}
......
......@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_dump.h,v 1.40 1999/10/23 03:13:26 tgl Exp $
* $Id: pg_dump.h,v 1.41 1999/11/22 17:56:36 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
......@@ -105,7 +105,7 @@ typedef struct _tableInfo
typedef struct _inhInfo
{
char *inhrel;
char *inhrelid;
char *inhparent;
} InhInfo;
......
......@@ -36,7 +36,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: catversion.h,v 1.2 1999/11/04 08:01:06 inoue Exp $
* $Id: catversion.h,v 1.3 1999/11/22 17:56:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -51,6 +51,6 @@
* catalog changes on the same day...)
*/
#define CATALOG_VERSION_NO 199911041
#define CATALOG_VERSION_NO 199911221
#endif
This diff is collapsed.
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_inheritproc.h,v 1.6 1999/02/13 23:21:10 momjian Exp $
* $Id: pg_inheritproc.h,v 1.7 1999/11/22 17:56:37 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -33,8 +33,8 @@
CATALOG(pg_inheritproc)
{
NameData inhproname;
Oid inhargrel;
Oid inhdefrel;
Oid inhargrelid;
Oid inhdefrelid;
Oid inhproc;
} FormData_pg_inheritproc;
......@@ -51,8 +51,8 @@ typedef FormData_pg_inheritproc *Form_pg_inheritproc;
*/
#define Natts_pg_inheritproc 4
#define Anum_pg_inheritproc_inhproname 1
#define Anum_pg_inheritproc_inhargrel 2
#define Anum_pg_inheritproc_inhdefrel 3
#define Anum_pg_inheritproc_inhargrelid 2
#define Anum_pg_inheritproc_inhdefrelid 3
#define Anum_pg_inheritproc_inhproc 4
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_inherits.h,v 1.7 1999/02/13 23:21:10 momjian Exp $
* $Id: pg_inherits.h,v 1.8 1999/11/22 17:56:37 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -32,7 +32,7 @@
*/
CATALOG(pg_inherits)
{
Oid inhrel;
Oid inhrelid;
Oid inhparent;
int4 inhseqno;
} FormData_pg_inherits;
......@@ -49,7 +49,7 @@ typedef FormData_pg_inherits *Form_pg_inherits;
* ----------------
*/
#define Natts_pg_inherits 3
#define Anum_pg_inherits_inhrel 1
#define Anum_pg_inherits_inhrelid 1
#define Anum_pg_inherits_inhparent 2
#define Anum_pg_inherits_inhseqno 3
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_ipl.h,v 1.6 1999/02/13 23:21:10 momjian Exp $
* $Id: pg_ipl.h,v 1.7 1999/11/22 17:56:37 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -32,7 +32,7 @@
*/
CATALOG(pg_ipl)
{
Oid iplrel;
Oid iplrelid;
Oid iplipl;
int4 iplseqno;
} FormData_pg_ipl;
......@@ -49,7 +49,7 @@ typedef FormData_pg_ipl *Form_pg_ipl;
* ----------------
*/
#define Natts_pg_ipl 3
#define Anum_pg_ipl_iplrel 1
#define Anum_pg_ipl_iplrelid 1
#define Anum_pg_ipl_iplipl 2
#define Anum_pg_ipl_iplseqno 3
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_opclass.h,v 1.20 1999/09/29 21:13:30 wieck Exp $
* $Id: pg_opclass.h,v 1.21 1999/11/22 17:56:37 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -68,9 +68,11 @@ DATA(insert OID = 422 ( box_ops 603 ));
DESCR("");
DATA(insert OID = 423 ( float8_ops 701 ));
DESCR("");
DATA(insert OID = 424 ( int24_ops 0 ));
/* Technically, deftype is wrong, but it must be unique for index, bjm */
DATA(insert OID = 424 ( int24_ops 424 ));
DESCR("");
DATA(insert OID = 425 ( int42_ops 0 ));
/* Technically, deftype is wrong, but it must be unique for index, bjm */
DATA(insert OID = 425 ( int42_ops 425 ));
DESCR("");
DATA(insert OID = 426 ( int4_ops 23 ));
DESCR("");
......@@ -85,7 +87,8 @@ DATA(insert OID = 431 ( text_ops 25 ));
DESCR("");
DATA(insert OID = 432 ( abstime_ops 702 ));
DESCR("");
DATA(insert OID = 433 ( bigbox_ops 603 ));
/* Technically, deftype is wrong, but it must be unique for index, bjm */
DATA(insert OID = 433 ( bigbox_ops 433 ));
DESCR("");
DATA(insert OID = 434 ( poly_ops 604 ));
DESCR("");
......@@ -109,13 +112,13 @@ DATA(insert OID = 1312 ( datetime_ops 1184 ));
DESCR("");
DATA(insert OID = 1313 ( timespan_ops 1186 ));
DESCR("");
DATA(insert OID = 810 ( macaddr_ops 829 ));
DATA(insert OID = 810 ( macaddr_ops 829 ));
DESCR("");
DATA(insert OID = 935 ( network_ops 869 ));
DATA(insert OID = 935 ( inet_ops 869 ));
DESCR("");
DATA(insert OID = 652 ( network_ops 650 ));
DATA(insert OID = 652 ( cidr_ops 650 ));
DESCR("");
DATA(insert OID = 1768 ( numeric_ops 1700 ));
DATA(insert OID = 1768 ( numeric_ops 1700 ));
DESCR("");
#endif /* PG_OPCLASS_H */
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_operator.h,v 1.60 1999/10/11 06:28:29 inoue Exp $
* $Id: pg_operator.h,v 1.61 1999/11/22 17:56:37 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -274,7 +274,13 @@ DATA(insert OID = 1283 ( ";" PGUID 0 l t f 0 701 701 0 0 0 0 dlog1 - - ));
DATA(insert OID = 1284 ( "|" PGUID 0 l t f 0 704 702 0 0 0 0 intervalstart - - ));
DATA(insert OID = 606 ( "<#>" PGUID 0 b t f 702 702 704 0 0 0 0 mktinterval - - ));
DATA(insert OID = 607 ( "=" PGUID 0 b t t 26 26 16 607 608 609 609 oideq eqsel eqjoinsel ));
#define MIN_OIDCMP 607 /* used by cache code */
DATA(insert OID = 608 ( "<>" PGUID 0 b t f 26 26 16 608 607 0 0 oidne neqsel neqjoinsel ));
DATA(insert OID = 609 ( "<" PGUID 0 b t f 26 26 16 610 612 0 0 int4lt intltsel intltjoinsel ));
DATA(insert OID = 610 ( ">" PGUID 0 b t f 26 26 16 609 611 0 0 int4gt intgtsel intgtjoinsel ));
DATA(insert OID = 611 ( "<=" PGUID 0 b t f 26 26 16 612 610 0 0 int4le intltsel intltjoinsel ));
DATA(insert OID = 612 ( ">=" PGUID 0 b t f 26 26 16 611 609 0 0 int4ge intgtsel intgtjoinsel ));
#define MAX_OIDCMP 612 /* used by cache code */
DATA(insert OID = 644 ( "<>" PGUID 0 b t f 30 30 16 644 649 0 0 oid8ne neqsel neqjoinsel ));
DATA(insert OID = 645 ( "<" PGUID 0 b t f 30 30 16 646 648 0 0 oid8lt intltsel intltjoinsel ));
......@@ -283,11 +289,6 @@ DATA(insert OID = 647 ( "<=" PGUID 0 b t f 30 30 16 648 646 0 0 oid8l
DATA(insert OID = 648 ( ">=" PGUID 0 b t f 30 30 16 647 645 0 0 oid8ge intgtsel intgtjoinsel ));
DATA(insert OID = 649 ( "=" PGUID 0 b t t 30 30 16 649 644 645 645 oid8eq eqsel eqjoinsel ));
DATA(insert OID = 609 ( "<" PGUID 0 b t f 26 26 16 610 612 0 0 int4lt intltsel intltjoinsel ));
DATA(insert OID = 610 ( ">" PGUID 0 b t f 26 26 16 609 611 0 0 int4gt intgtsel intgtjoinsel ));
DATA(insert OID = 611 ( "<=" PGUID 0 b t f 26 26 16 612 610 0 0 int4le intltsel intltjoinsel ));
DATA(insert OID = 612 ( ">=" PGUID 0 b t f 26 26 16 611 609 0 0 int4ge intgtsel intgtjoinsel ));
DATA(insert OID = 613 ( "<->" PGUID 0 b t f 600 628 701 0 0 0 0 dist_pl - - ));
DATA(insert OID = 614 ( "<->" PGUID 0 b t f 600 601 701 0 0 0 0 dist_ps - - ));
DATA(insert OID = 615 ( "<->" PGUID 0 b t f 600 603 701 0 0 0 0 dist_pb - - ));
......
......@@ -8,7 +8,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: syscache.h,v 1.20 1999/11/01 02:29:27 momjian Exp $
* $Id: syscache.h,v 1.21 1999/11/22 17:56:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -27,39 +27,36 @@
*
* The order of these must match the order
* they are entered into the structure cacheinfo[] in syscache.c
* The best thing to do is to add yours at the END, because some
* code assumes that certain caches are at certain places in this
* array.
* Keep them in alphabeticall order.
*/
#define AMOPOPID 0
#define AMOPSTRATEGY 1
#define ATTNAME 2
#define ATTNUM 3
#define INDEXRELID 4
#define LANNAME 5
#define OPRNAME 6
#define OPROID 7
#define PRONAME 8
#define PROOID 9
#define RELNAME 10
#define RELOID 11
#define TYPNAME 12
#define TYPOID 13
#define AMNAME 14
#define CLANAME 15
/* #define INDRELIDKEY 16 */
#define INHRELID 16
#define RULOID 17
#define AGGNAME 18
#define LISTENREL 19
#define USENAME 20
#define USESYSID 21
#define GRONAME 22
#define GROSYSID 23
#define REWRITENAME 24
#define CLADEFTYPE 25
#define LANOID 26
#define AGGNAME 0
#define AMNAME 1
#define AMOPOPID 2
#define AMOPSTRATEGY 3
#define ATTNAME 4
#define ATTNUM 5
#define CLADEFTYPE 6
#define CLANAME 7
#define GRONAME 8
#define GROSYSID 9
#define INDEXRELID 10
#define INHRELID 11
#define LANGNAME 12
#define LANGOID 13
#define LISTENREL 14
#define OPERNAME 15
#define OPEROID 16
#define PROCNAME 17
#define PROCOID 18
#define RELNAME 19
#define RELOID 20
#define RULENAME 21
#define RULEOID 22
#define TYPENAME 23
#define TYPEOID 24
#define USERNAME 25
#define USERSYSID 26
/* ----------------
* struct cachedesc: information needed for a call to InitSysCache()
......
......@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.12 1999/11/07 23:08:34 momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.13 1999/11/22 17:56:39 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
......@@ -132,7 +132,7 @@ plpgsql_compile(Oid fn_oid, int functype)
* Lookup the pg_proc tuple by Oid
* ----------
*/
procTup = SearchSysCacheTuple(PROOID,
procTup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(fn_oid),
0, 0, 0);
if (!HeapTupleIsValid(procTup))
......@@ -174,7 +174,7 @@ plpgsql_compile(Oid fn_oid, int functype)
* Lookup the functions return type
* ----------
*/
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procStruct->prorettype), 0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -205,7 +205,7 @@ plpgsql_compile(Oid fn_oid, int functype)
* Get the parameters type
* ----------
*/
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procStruct->proargtypes[i]), 0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -601,7 +601,7 @@ plpgsql_parse_word(char *word)
* ----------
*/
typeXlated = xlateSqlType(cp);
typeTup = SearchSysCacheTuple(TYPNAME,
typeTup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(typeXlated), 0, 0, 0);
if (HeapTupleIsValid(typeTup))
{
......@@ -924,7 +924,7 @@ plpgsql_parse_wordtype(char *word)
* ----------
*/
typeXlated = xlateSqlType(cp);
typeTup = SearchSysCacheTuple(TYPNAME,
typeTup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(typeXlated), 0, 0, 0);
if (HeapTupleIsValid(typeTup))
{
......@@ -1067,7 +1067,7 @@ plpgsql_parse_dblwordtype(char *string)
}
attrStruct = (Form_pg_attribute) GETSTRUCT(attrtup);
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(attrStruct->atttypid), 0, 0, 0);
if (!HeapTupleIsValid(typetup))
{
......@@ -1143,7 +1143,7 @@ plpgsql_parse_wordrowtype(char *string)
* Fetch the tables pg_type tuple too
* ----------
*/
typetup = SearchSysCacheTuple(TYPNAME,
typetup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(word1), 0, 0, 0);
if (!HeapTupleIsValid(typetup))
{
......@@ -1182,7 +1182,7 @@ plpgsql_parse_wordrowtype(char *string)
}
attrStruct = (Form_pg_attribute) GETSTRUCT(attrtup);
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(attrStruct->atttypid), 0, 0, 0);
if (!HeapTupleIsValid(typetup))
{
......
......@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.14 1999/11/07 23:08:35 momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.15 1999/11/22 17:56:40 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
......@@ -1553,7 +1553,7 @@ exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt)
extval = "<NULL>";
else
{
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(var->datatype->typoid), 0, 0, 0);
if (!HeapTupleIsValid(typetup))
elog(ERROR, "cache lookup for type %u failed (1)", var->datatype->typoid);
......@@ -1958,7 +1958,7 @@ exec_assign_value(PLpgSQL_execstate * estate,
*/
atttype = SPI_gettypeid(rec->tupdesc, i + 1);
atttypmod = rec->tupdesc->attrs[i]->atttypmod;
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(atttype), 0, 0, 0);
if (!HeapTupleIsValid(typetup))
elog(ERROR, "cache lookup for type %u failed", atttype);
......@@ -2389,7 +2389,7 @@ exec_cast_value(Datum value, Oid valtype,
FmgrInfo finfo_output;
char *extval;
typetup = SearchSysCacheTuple(TYPOID,
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(valtype), 0, 0, 0);
if (!HeapTupleIsValid(typetup))
elog(ERROR, "cache lookup for type %u failed", valtype);
......
......@@ -3,7 +3,7 @@
* procedural language (PL)
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.14 1999/11/07 23:08:36 momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.15 1999/11/22 17:56:41 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
......@@ -467,7 +467,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
/************************************************************
* Lookup the pg_proc tuple by Oid
************************************************************/
procTup = SearchSysCacheTuple(PROOID,
procTup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(proinfo->fn_oid),
0, 0, 0);
if (!HeapTupleIsValid(procTup))
......@@ -482,7 +482,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
* Get the required information for input conversion of the
* return value.
************************************************************/
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procStruct->prorettype),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -512,7 +512,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
proc_internal_args[0] = '\0';
for (i = 0; i < proinfo->fn_nargs; i++)
{
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procStruct->proargtypes[i]),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -798,7 +798,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
/************************************************************
* Lookup the pg_proc tuple by Oid
************************************************************/
procTup = SearchSysCacheTuple(PROOID,
procTup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(proinfo->fn_oid),
0, 0, 0);
if (!HeapTupleIsValid(procTup))
......@@ -1120,7 +1120,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
* Lookup the attribute type in the syscache
* for the input function
************************************************************/
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -1592,7 +1592,7 @@ pltcl_SPI_prepare(ClientData cdata, Tcl_Interp *interp,
************************************************************/
for (i = 0; i < nargs; i++)
{
typeTup = SearchSysCacheTuple(TYPNAME,
typeTup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(args[i]),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -2137,7 +2137,7 @@ pltcl_set_tuple_values(Tcl_Interp *interp, char *arrayname,
* Lookup the attribute type in the syscache
* for the output function
************************************************************/
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(tupdesc->attrs[i]->atttypid),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......@@ -2210,7 +2210,7 @@ pltcl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc,
* Lookup the attribute type in the syscache
* for the output function
************************************************************/
typeTup = SearchSysCacheTuple(TYPOID,
typeTup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(tupdesc->attrs[i]->atttypid),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment