aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/parse_coerce.c27
-rw-r--r--src/backend/parser/parse_func.c11
-rw-r--r--src/backend/parser/parse_node.c6
-rw-r--r--src/backend/parser/parse_oper.c26
-rw-r--r--src/backend/parser/parse_relation.c30
-rw-r--r--src/backend/parser/parse_type.c21
-rw-r--r--src/backend/parser/parse_utilcmd.c20
7 files changed, 51 insertions, 90 deletions
diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index b6bead8a18c..66ce032cee6 100644
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.179 2010/01/02 16:57:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.180 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -684,9 +684,7 @@ build_coercion_expression(Node *node,
HeapTuple tp;
Form_pg_proc procstruct;
- tp = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcId),
- 0, 0, 0);
+ tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for function %u", funcId);
procstruct = (Form_pg_proc) GETSTRUCT(tp);
@@ -1787,10 +1785,9 @@ IsBinaryCoercible(Oid srctype, Oid targettype)
return true;
/* Else look in pg_cast */
- tuple = SearchSysCache(CASTSOURCETARGET,
- ObjectIdGetDatum(srctype),
- ObjectIdGetDatum(targettype),
- 0, 0);
+ tuple = SearchSysCache2(CASTSOURCETARGET,
+ ObjectIdGetDatum(srctype),
+ ObjectIdGetDatum(targettype));
if (!HeapTupleIsValid(tuple))
return false; /* no cast */
castForm = (Form_pg_cast) GETSTRUCT(tuple);
@@ -1852,10 +1849,9 @@ find_coercion_pathway(Oid targetTypeId, Oid sourceTypeId,
return COERCION_PATH_RELABELTYPE;
/* Look in pg_cast */
- tuple = SearchSysCache(CASTSOURCETARGET,
- ObjectIdGetDatum(sourceTypeId),
- ObjectIdGetDatum(targetTypeId),
- 0, 0);
+ tuple = SearchSysCache2(CASTSOURCETARGET,
+ ObjectIdGetDatum(sourceTypeId),
+ ObjectIdGetDatum(targetTypeId));
if (HeapTupleIsValid(tuple))
{
@@ -2017,10 +2013,9 @@ find_typmod_coercion_function(Oid typeId,
ReleaseSysCache(targetType);
/* Look in pg_cast */
- tuple = SearchSysCache(CASTSOURCETARGET,
- ObjectIdGetDatum(typeId),
- ObjectIdGetDatum(typeId),
- 0, 0);
+ tuple = SearchSysCache2(CASTSOURCETARGET,
+ ObjectIdGetDatum(typeId),
+ ObjectIdGetDatum(typeId));
if (HeapTupleIsValid(tuple))
{
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 04089971004..df34711af6e 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.220 2010/01/02 16:57:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.221 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1108,9 +1108,8 @@ func_get_detail(List *funcname,
}
}
- ftup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(best_candidate->oid),
- 0, 0, 0);
+ ftup = SearchSysCache1(PROCOID,
+ ObjectIdGetDatum(best_candidate->oid));
if (!HeapTupleIsValid(ftup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u",
best_candidate->oid);
@@ -1563,9 +1562,7 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
}
/* Make sure it's an aggregate */
- ftup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0);
+ ftup = SearchSysCache1(PROCOID, ObjectIdGetDatum(oid));
if (!HeapTupleIsValid(ftup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", oid);
pform = (Form_pg_proc) GETSTRUCT(ftup);
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 86459af716b..59f1245fd6b 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.107 2010/01/02 16:57:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.108 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -208,9 +208,7 @@ transformArrayType(Oid arrayType)
Form_pg_type type_struct_array;
/* Get the type tuple for the array */
- type_tuple_array = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(arrayType),
- 0, 0, 0);
+ type_tuple_array = SearchSysCache1(TYPEOID, ObjectIdGetDatum(arrayType));
if (!HeapTupleIsValid(type_tuple_array))
elog(ERROR, "cache lookup failed for type %u", arrayType);
type_struct_array = (Form_pg_type) GETSTRUCT(type_tuple_array);
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 98af55274e3..daa9e2341fa 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.111 2010/01/02 16:57:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.112 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -421,9 +421,7 @@ oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId,
operOid = find_oper_cache_entry(&key);
if (OidIsValid(operOid))
{
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
return (Operator) tup;
}
@@ -463,9 +461,7 @@ oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId,
}
if (OidIsValid(operOid))
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
{
@@ -571,9 +567,7 @@ right_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
operOid = find_oper_cache_entry(&key);
if (OidIsValid(operOid))
{
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
return (Operator) tup;
}
@@ -605,9 +599,7 @@ right_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
}
if (OidIsValid(operOid))
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
{
@@ -653,9 +645,7 @@ left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
operOid = find_oper_cache_entry(&key);
if (OidIsValid(operOid))
{
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
return (Operator) tup;
}
@@ -699,9 +689,7 @@ left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
}
if (OidIsValid(operOid))
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
{
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 19dd9446f53..34f2dc410bd 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.148 2010/01/02 16:57:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.149 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -502,10 +502,9 @@ scanRTEForColumn(ParseState *pstate, RangeTblEntry *rte, char *colname,
if (attnum != InvalidAttrNumber)
{
/* now check to see if column actually is defined */
- if (SearchSysCacheExists(ATTNUM,
- ObjectIdGetDatum(rte->relid),
- Int16GetDatum(attnum),
- 0, 0))
+ if (SearchSysCacheExists2(ATTNUM,
+ ObjectIdGetDatum(rte->relid),
+ Int16GetDatum(attnum)))
{
var = make_var(pstate, rte, attnum, location);
/* Require read access to the column */
@@ -1979,10 +1978,9 @@ get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
HeapTuple tp;
Form_pg_attribute att_tup;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(rte->relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(rte->relid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(tp)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, rte->relid);
@@ -2133,10 +2131,9 @@ get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum)
HeapTuple tp;
Form_pg_attribute att_tup;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(rte->relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(rte->relid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(tp)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, rte->relid);
@@ -2186,10 +2183,9 @@ get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum)
HeapTuple tp;
Form_pg_attribute att_tup;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(funcrelid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(funcrelid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(tp)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, funcrelid);
diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c
index 61d704d1834..006f406455d 100644
--- a/src/backend/parser/parse_type.c
+++ b/src/backend/parser/parse_type.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.105 2010/01/02 16:57:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.106 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -143,10 +143,9 @@ LookupTypeName(ParseState *pstate, const TypeName *typeName,
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- typoid = GetSysCacheOid(TYPENAMENSP,
- PointerGetDatum(typname),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ typoid = GetSysCacheOid2(TYPENAMENSP,
+ PointerGetDatum(typname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
@@ -166,9 +165,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typeName,
return NULL;
}
- tup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typoid),
- 0, 0, 0);
+ tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typoid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for type %u", typoid);
@@ -423,9 +420,7 @@ typeidType(Oid id)
{
HeapTuple tup;
- tup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(id),
- 0, 0, 0);
+ tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(id));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", id);
return (Type) tup;
@@ -532,9 +527,7 @@ typeidTypeRelid(Oid type_id)
Form_pg_type type;
Oid result;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type_id),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", type_id);
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index f2b29d327c7..4a5a5725455 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -19,7 +19,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.38 2010/02/03 05:46:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.39 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -889,9 +889,7 @@ generateClonedIndexStmt(CreateStmtContext *cxt, Relation source_idx,
* Fetch pg_class tuple of source index. We can't use the copy in the
* relcache entry because it doesn't include optional fields.
*/
- ht_idxrel = SearchSysCache(RELOID,
- ObjectIdGetDatum(source_relid),
- 0, 0, 0);
+ ht_idxrel = SearchSysCache1(RELOID, ObjectIdGetDatum(source_relid));
if (!HeapTupleIsValid(ht_idxrel))
elog(ERROR, "cache lookup failed for relation %u", source_relid);
idxrelrec = (Form_pg_class) GETSTRUCT(ht_idxrel);
@@ -943,9 +941,8 @@ generateClonedIndexStmt(CreateStmtContext *cxt, Relation source_idx,
HeapTuple ht_constr;
Form_pg_constraint conrec;
- ht_constr = SearchSysCache(CONSTROID,
- ObjectIdGetDatum(constraintId),
- 0, 0, 0);
+ ht_constr = SearchSysCache1(CONSTROID,
+ ObjectIdGetDatum(constraintId));
if (!HeapTupleIsValid(ht_constr))
elog(ERROR, "cache lookup failed for constraint %u",
constraintId);
@@ -984,9 +981,8 @@ generateClonedIndexStmt(CreateStmtContext *cxt, Relation source_idx,
char *nspname;
List *namelist;
- opertup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operid),
- 0, 0, 0);
+ opertup = SearchSysCache1(OPEROID,
+ ObjectIdGetDatum(operid));
if (!HeapTupleIsValid(opertup))
elog(ERROR, "cache lookup failed for operator %u",
operid);
@@ -1138,9 +1134,7 @@ get_opclass(Oid opclass, Oid actual_datatype)
Form_pg_opclass opc_rec;
List *result = NIL;
- ht_opc = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opclass),
- 0, 0, 0);
+ ht_opc = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclass));
if (!HeapTupleIsValid(ht_opc))
elog(ERROR, "cache lookup failed for opclass %u", opclass);
opc_rec = (Form_pg_opclass) GETSTRUCT(ht_opc);