mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Add system indexes to match all caches.
Make all system indexes unique. Make all cache loads use system indexes. Rename *rel to *relid in inheritance tables. Rename cache names to be clearer.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user