mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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/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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user