* Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
*
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.88 2010/02/03 23:01:11 joe Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.89 2010/02/14 18:42:11 rhaas Exp $
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
char *nspname;
char *result;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for relation %u", relid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.132 2010/01/22 16:40:18 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.133 2010/02/14 18:42:12 rhaas Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
att->attinhcount = 0;
/* attacl and attoptions are not present in tupledescs */
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(oidtypeid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(oidtypeid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for type %u", oidtypeid);
typeForm = (Form_pg_type) GETSTRUCT(tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.286 2010/02/08 04:33:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.287 2010/02/14 18:42:12 rhaas Exp $
*
*
* INTERFACE ROUTINES
* Now that we have the lock, probe to see if the relation really exists
* or not.
*/
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(relationId),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(relationId)))
{
/* Release useless lock */
if (lockmode != NoLock)
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.87 2010/01/02 16:57:35 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.88 2010/02/14 18:42:12 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
if (TransactionIdFollowsOrEquals(nextXid, xidVacLimit) &&
TransactionIdIsValid(xidVacLimit))
return true; /* past VacLimit, don't delay updating */
- if (!SearchSysCacheExists(DATABASEOID,
- ObjectIdGetDatum(oldestXidDB),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(DATABASEOID, ObjectIdGetDatum(oldestXidDB)))
return true; /* could happen, per comments above */
return false;
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.161 2010/01/07 02:41:15 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.162 2010/02/14 18:42:12 rhaas Exp $
*
* NOTES
* See acl.h.
char *langname = strVal(lfirst(cell));
HeapTuple tuple;
- tuple = SearchSysCache(LANGNAME,
- PointerGetDatum(langname),
- 0, 0, 0);
+ tuple = SearchSysCache1(LANGNAME, PointerGetDatum(langname));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
char *nspname = strVal(lfirst(cell));
HeapTuple tuple;
- tuple = SearchSysCache(NAMESPACENAME,
- CStringGetDatum(nspname),
- 0, 0, 0);
+ tuple = SearchSysCache1(NAMESPACENAME,
+ CStringGetDatum(nspname));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
* CREATE privileges, since without CREATE you won't be able to do
* anything using the default privs anyway.
*/
- iacls->nspid = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(nspname),
- 0, 0, 0);
+ iacls->nspid = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(nspname));
if (!OidIsValid(iacls->nspid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
}
/* Search for existing row for this object type in catalog */
- tuple = SearchSysCache(DEFACLROLENSPOBJ,
- ObjectIdGetDatum(iacls->roleid),
- ObjectIdGetDatum(iacls->nspid),
- CharGetDatum(objtype),
- 0);
+ tuple = SearchSysCache3(DEFACLROLENSPOBJ,
+ ObjectIdGetDatum(iacls->roleid),
+ ObjectIdGetDatum(iacls->nspid),
+ CharGetDatum(objtype));
if (HeapTupleIsValid(tuple))
{
if (classForm->relkind == RELKIND_VIEW && curr_att < 0)
continue;
- attTuple = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(table_oid),
- Int16GetDatum(curr_att),
- 0, 0);
+ attTuple = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(table_oid),
+ Int16GetDatum(curr_att));
if (!HeapTupleIsValid(attTuple))
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
curr_att, table_oid);
Oid *oldmembers;
Oid *newmembers;
- attr_tuple = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(relOid),
- Int16GetDatum(attnum),
- 0, 0);
+ attr_tuple = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(relOid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(attr_tuple))
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, relOid);
HeapTuple tuple;
ListCell *cell_colprivs;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relOid);
pg_class_tuple = (Form_pg_class) GETSTRUCT(tuple);
Oid *newmembers;
HeapTuple tuple;
- tuple = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(datId),
- 0, 0, 0);
+ tuple = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(datId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for database %u", datId);
Oid *oldmembers;
Oid *newmembers;
- tuple = SearchSysCache(FOREIGNDATAWRAPPEROID,
- ObjectIdGetDatum(fdwid),
- 0, 0, 0);
+ tuple = SearchSysCache1(FOREIGNDATAWRAPPEROID,
+ ObjectIdGetDatum(fdwid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for foreign-data wrapper %u", fdwid);
Oid *oldmembers;
Oid *newmembers;
- tuple = SearchSysCache(FOREIGNSERVEROID,
- ObjectIdGetDatum(srvid),
- 0, 0, 0);
+ tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(srvid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for foreign server %u", srvid);
Oid *oldmembers;
Oid *newmembers;
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcId),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcId);
Oid *oldmembers;
Oid *newmembers;
- tuple = SearchSysCache(LANGOID,
- ObjectIdGetDatum(langId),
- 0, 0, 0);
+ tuple = SearchSysCache1(LANGOID, ObjectIdGetDatum(langId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for language %u", langId);
Oid *oldmembers;
Oid *newmembers;
- tuple = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(nspid),
- 0, 0, 0);
+ tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(nspid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for namespace %u", nspid);
HeapTuple tuple;
/* Search syscache for pg_tablespace */
- tuple = SearchSysCache(TABLESPACEOID, ObjectIdGetDatum(tblId),
- 0, 0, 0);
+ tuple = SearchSysCache1(TABLESPACEOID, ObjectIdGetDatum(tblId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for tablespace %u", tblId);
bool rolcatupdate;
HeapTuple tuple;
- tuple = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(roleid),
- 0, 0, 0);
+ tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
/*
* First, get the column's ACL from its pg_attribute entry
*/
- attTuple = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(table_oid),
- Int16GetDatum(attnum),
- 0, 0);
+ attTuple = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(table_oid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(attTuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),
* privileges" rather than failing in such a case, so as to avoid unwanted
* failures in has_column_privilege() tests.
*/
- classTuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(table_oid),
- 0, 0, 0);
+ classTuple = SearchSysCache1(RELOID, ObjectIdGetDatum(table_oid));
if (!HeapTupleIsValid(classTuple))
{
ReleaseSysCache(attTuple);
/*
* Must get the relation's tuple from pg_class
*/
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(table_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(table_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_TABLE),
/*
* Get the database's ACL from pg_database
*/
- tuple = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(db_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(db_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_DATABASE),
/*
* Get the function's ACL from pg_proc
*/
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(proc_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(proc_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
/*
* Get the language's ACL from pg_language
*/
- tuple = SearchSysCache(LANGOID,
- ObjectIdGetDatum(lang_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(LANGOID, ObjectIdGetDatum(lang_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
/*
* Get the schema's ACL from pg_namespace
*/
- tuple = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(nsp_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(nsp_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
/*
* Get the tablespace's ACL from pg_tablespace
*/
- tuple = SearchSysCache(TABLESPACEOID, ObjectIdGetDatum(spc_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TABLESPACEOID, ObjectIdGetDatum(spc_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
/*
* Must get the FDW's tuple from pg_foreign_data_wrapper
*/
- tuple = SearchSysCache(FOREIGNDATAWRAPPEROID,
- ObjectIdGetDatum(fdw_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(FOREIGNDATAWRAPPEROID, ObjectIdGetDatum(fdw_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errmsg("foreign-data wrapper with OID %u does not exist",
/*
* Must get the FDW's tuple from pg_foreign_data_wrapper
*/
- tuple = SearchSysCache(FOREIGNSERVEROID,
- ObjectIdGetDatum(srv_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(srv_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errmsg("foreign server with OID %u does not exist",
* pg_attribute_aclmask, we prefer to return "no privileges" instead of
* throwing an error if we get any unexpected lookup errors.
*/
- classTuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(table_oid),
- 0, 0, 0);
+ classTuple = SearchSysCache1(RELOID, ObjectIdGetDatum(table_oid));
if (!HeapTupleIsValid(classTuple))
return ACLCHECK_NO_PRIV;
classForm = (Form_pg_class) GETSTRUCT(classTuple);
HeapTuple attTuple;
AclMode attmask;
- attTuple = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(table_oid),
- Int16GetDatum(curr_att),
- 0, 0);
+ attTuple = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(table_oid),
+ Int16GetDatum(curr_att));
if (!HeapTupleIsValid(attTuple))
continue;
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(class_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(class_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_TABLE),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(OPEROID,
- ObjectIdGetDatum(oper_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(OPEROID, ObjectIdGetDatum(oper_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(proc_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(proc_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(LANGOID,
- ObjectIdGetDatum(lan_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(LANGOID, ObjectIdGetDatum(lan_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(nsp_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(nsp_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
return true;
/* Search syscache for pg_tablespace */
- spctuple = SearchSysCache(TABLESPACEOID, ObjectIdGetDatum(spc_oid),
- 0, 0, 0);
+ spctuple = SearchSysCache1(TABLESPACEOID, ObjectIdGetDatum(spc_oid));
if (!HeapTupleIsValid(spctuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opc_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(CLAOID, ObjectIdGetDatum(opc_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opf_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opf_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dict_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dict_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfg_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfg_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(FOREIGNSERVEROID,
- ObjectIdGetDatum(srv_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(srv_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(db_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(db_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_DATABASE),
if (superuser_arg(roleid))
return true;
- tuple = SearchSysCache(CONVOID,
- ObjectIdGetDatum(conv_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(CONVOID, ObjectIdGetDatum(conv_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
Acl *result = NULL;
HeapTuple tuple;
- tuple = SearchSysCache(DEFACLROLENSPOBJ,
- ObjectIdGetDatum(roleId),
- ObjectIdGetDatum(nsp_oid),
- CharGetDatum(objtype),
- 0);
+ tuple = SearchSysCache3(DEFACLROLENSPOBJ,
+ ObjectIdGetDatum(roleId),
+ ObjectIdGetDatum(nsp_oid),
+ CharGetDatum(objtype));
if (HeapTupleIsValid(tuple))
{
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.94 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.95 2010/02/14 18:42:12 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
case REGPROCOID:
case REGPROCEDUREOID:
objoid = DatumGetObjectId(con->constvalue);
- if (SearchSysCacheExists(PROCOID,
- ObjectIdGetDatum(objoid),
- 0, 0, 0))
+ if (SearchSysCacheExists1(PROCOID,
+ ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_PROC, objoid, 0,
context->addrs);
break;
case REGOPEROID:
case REGOPERATOROID:
objoid = DatumGetObjectId(con->constvalue);
- if (SearchSysCacheExists(OPEROID,
- ObjectIdGetDatum(objoid),
- 0, 0, 0))
+ if (SearchSysCacheExists1(OPEROID,
+ ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_OPERATOR, objoid, 0,
context->addrs);
break;
case REGCLASSOID:
objoid = DatumGetObjectId(con->constvalue);
- if (SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(objoid),
- 0, 0, 0))
+ if (SearchSysCacheExists1(RELOID,
+ ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_CLASS, objoid, 0,
context->addrs);
break;
case REGTYPEOID:
objoid = DatumGetObjectId(con->constvalue);
- if (SearchSysCacheExists(TYPEOID,
- ObjectIdGetDatum(objoid),
- 0, 0, 0))
+ if (SearchSysCacheExists1(TYPEOID,
+ ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_TYPE, objoid, 0,
context->addrs);
break;
case REGCONFIGOID:
objoid = DatumGetObjectId(con->constvalue);
- if (SearchSysCacheExists(TSCONFIGOID,
- ObjectIdGetDatum(objoid),
- 0, 0, 0))
+ if (SearchSysCacheExists1(TSCONFIGOID,
+ ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_TSCONFIG, objoid, 0,
context->addrs);
break;
case REGDICTIONARYOID:
objoid = DatumGetObjectId(con->constvalue);
- if (SearchSysCacheExists(TSDICTOID,
- ObjectIdGetDatum(objoid),
- 0, 0, 0))
+ if (SearchSysCacheExists1(TSDICTOID,
+ ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_TSDICT, objoid, 0,
context->addrs);
break;
HeapTuple conTup;
Form_pg_constraint con;
- conTup = SearchSysCache(CONSTROID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ conTup = SearchSysCache1(CONSTROID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(conTup))
elog(ERROR, "cache lookup failed for constraint %u",
object->objectId);
{
HeapTuple conTup;
- conTup = SearchSysCache(CONVOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ conTup = SearchSysCache1(CONVOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(conTup))
elog(ERROR, "cache lookup failed for conversion %u",
object->objectId);
{
HeapTuple langTup;
- langTup = SearchSysCache(LANGOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ langTup = SearchSysCache1(LANGOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(langTup))
elog(ERROR, "cache lookup failed for language %u",
object->objectId);
Form_pg_am amForm;
char *nspname;
- opcTup = SearchSysCache(CLAOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ opcTup = SearchSysCache1(CLAOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(opcTup))
elog(ERROR, "cache lookup failed for opclass %u",
object->objectId);
opcForm = (Form_pg_opclass) GETSTRUCT(opcTup);
- amTup = SearchSysCache(AMOID,
- ObjectIdGetDatum(opcForm->opcmethod),
- 0, 0, 0);
+ amTup = SearchSysCache1(AMOID,
+ ObjectIdGetDatum(opcForm->opcmethod));
if (!HeapTupleIsValid(amTup))
elog(ERROR, "cache lookup failed for access method %u",
opcForm->opcmethod);
{
HeapTuple tup;
- tup = SearchSysCache(TSPARSEROID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSPARSEROID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search parser %u",
object->objectId);
{
HeapTuple tup;
- tup = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSDICTOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search dictionary %u",
object->objectId);
{
HeapTuple tup;
- tup = SearchSysCache(TSTEMPLATEOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSTEMPLATEOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search template %u",
object->objectId);
{
HeapTuple tup;
- tup = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSCONFIGOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search configuration %u",
object->objectId);
Oid useid;
char *usename;
- tup = SearchSysCache(USERMAPPINGOID,
- ObjectIdGetDatum(object->objectId),
- 0, 0, 0);
+ tup = SearchSysCache1(USERMAPPINGOID,
+ ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for user mapping %u",
object->objectId);
char *nspname;
char *relname;
- relTup = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ relTup = SearchSysCache1(RELOID,
+ ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(relTup))
elog(ERROR, "cache lookup failed for relation %u", relid);
relForm = (Form_pg_class) GETSTRUCT(relTup);
Form_pg_am amForm;
char *nspname;
- opfTup = SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opfid),
- 0, 0, 0);
+ opfTup = SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opfid));
if (!HeapTupleIsValid(opfTup))
elog(ERROR, "cache lookup failed for opfamily %u", opfid);
opfForm = (Form_pg_opfamily) GETSTRUCT(opfTup);
- amTup = SearchSysCache(AMOID,
- ObjectIdGetDatum(opfForm->opfmethod),
- 0, 0, 0);
+ amTup = SearchSysCache1(AMOID, ObjectIdGetDatum(opfForm->opfmethod));
if (!HeapTupleIsValid(amTup))
elog(ERROR, "cache lookup failed for access method %u",
opfForm->opfmethod);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.370 2010/02/07 20:48:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.371 2010/02/14 18:42:13 rhaas Exp $
*
*
* INTERFACE ROUTINES
* autogenerated array, we can rename it out of the way; otherwise we can
* at least give a good error message.
*/
- old_type_oid = GetSysCacheOid(TYPENAMENSP,
- CStringGetDatum(relname),
- ObjectIdGetDatum(relnamespace),
- 0, 0);
+ old_type_oid = GetSysCacheOid2(TYPENAMENSP,
+ CStringGetDatum(relname),
+ ObjectIdGetDatum(relnamespace));
if (OidIsValid(old_type_oid))
{
if (!moveArrayTypeName(old_type_oid, relname, relnamespace))
/* Grab an appropriate lock on the pg_class relation */
pg_class_desc = heap_open(RelationRelationId, RowExclusiveLock);
- tup = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tup = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for relation %u", relid);
attr_rel = heap_open(AttributeRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(ATTNUM,
- ObjectIdGetDatum(relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tuple = SearchSysCacheCopy2(ATTNUM,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, relid);
/* Fix the pg_attribute row */
attr_rel = heap_open(AttributeRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(ATTNUM,
- ObjectIdGetDatum(myrelid),
- Int16GetDatum(myattnum),
- 0, 0);
+ tuple = SearchSysCacheCopy2(ATTNUM,
+ ObjectIdGetDatum(myrelid),
+ Int16GetDatum(myattnum));
if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
myattnum, myrelid);
* exists.
*/
attrrel = heap_open(AttributeRelationId, RowExclusiveLock);
- atttup = SearchSysCacheCopy(ATTNUM,
- ObjectIdGetDatum(RelationGetRelid(rel)),
- Int16GetDatum(attnum),
- 0, 0);
+ atttup = SearchSysCacheCopy2(ATTNUM,
+ ObjectIdGetDatum(RelationGetRelid(rel)),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(atttup))
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, RelationGetRelid(rel));
Form_pg_class relStruct;
relrel = heap_open(RelationRelationId, RowExclusiveLock);
- reltup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(RelationGetRelid(rel)),
- 0, 0, 0);
+ reltup = SearchSysCacheCopy1(RELOID,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
if (!HeapTupleIsValid(reltup))
elog(ERROR, "cache lookup failed for relation %u",
RelationGetRelid(rel));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.335 2010/02/08 04:33:53 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.336 2010/02/14 18:42:13 rhaas Exp $
*
*
* INTERFACE ROUTINES
int i;
/* We need access to the index AM's pg_am tuple */
- amtuple = SearchSysCache(AMOID,
- ObjectIdGetDatum(accessMethodObjectId),
- 0, 0, 0);
+ amtuple = SearchSysCache1(AMOID,
+ ObjectIdGetDatum(accessMethodObjectId));
if (!HeapTupleIsValid(amtuple))
elog(ERROR, "cache lookup failed for access method %u",
accessMethodObjectId);
* Lookup the expression type in pg_type for the type length etc.
*/
keyType = exprType(indexkey);
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(keyType),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(keyType));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for type %u", keyType);
typeTup = (Form_pg_type) GETSTRUCT(tuple);
* Check the opclass and index AM to see if either provides a keytype
* (overriding the attribute type). Opclass takes precedence.
*/
- tuple = SearchSysCache(CLAOID,
- ObjectIdGetDatum(classObjectId[i]),
- 0, 0, 0);
+ tuple = SearchSysCache1(CLAOID, ObjectIdGetDatum(classObjectId[i]));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for opclass %u",
classObjectId[i]);
if (OidIsValid(keyType) && keyType != to->atttypid)
{
/* index value and heap value have different types */
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(keyType),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(keyType));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for type %u", keyType);
typeTup = (Form_pg_type) GETSTRUCT(tuple);
*/
indexRelation = heap_open(IndexRelationId, RowExclusiveLock);
- tuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexId),
- 0, 0, 0);
+ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for index %u", indexId);
else
{
/* normal case, use syscache */
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relid));
}
if (!HeapTupleIsValid(tuple))
pg_index = heap_open(IndexRelationId, RowExclusiveLock);
- indexTuple = SearchSysCacheCopy(INDEXRELID,
- ObjectIdGetDatum(indexId),
- 0, 0, 0);
+ indexTuple = SearchSysCacheCopy1(INDEXRELID,
+ ObjectIdGetDatum(indexId));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexId);
indexForm = (Form_pg_index) GETSTRUCT(indexTuple);
Form_pg_index index;
Oid result;
- tuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexId),
- 0, 0, 0);
+ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for index %u", indexId);
index = (Form_pg_index) GETSTRUCT(tuple);
{
pg_index = heap_open(IndexRelationId, RowExclusiveLock);
- indexTuple = SearchSysCacheCopy(INDEXRELID,
- ObjectIdGetDatum(indexId),
- 0, 0, 0);
+ indexTuple = SearchSysCacheCopy1(INDEXRELID,
+ ObjectIdGetDatum(indexId));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexId);
indexForm = (Form_pg_index) GETSTRUCT(indexTuple);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.122 2010/02/02 18:52:33 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.123 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
return myTempNamespace;
}
/* use exact schema given */
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(newRelation->schemaname),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(newRelation->schemaname));
if (!OidIsValid(namespaceId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
Oid relnamespace;
bool visible;
- reltup = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ reltup = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(reltup))
elog(ERROR, "cache lookup failed for relation %u", relid);
relform = (Form_pg_class) GETSTRUCT(reltup);
{
Oid namespaceId = lfirst_oid(l);
- typid = GetSysCacheOid(TYPENAMENSP,
- PointerGetDatum(typname),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ typid = GetSysCacheOid2(TYPENAMENSP,
+ PointerGetDatum(typname),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(typid))
return typid;
}
Oid typnamespace;
bool visible;
- typtup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ typtup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(typtup))
elog(ERROR, "cache lookup failed for type %u", typid);
typform = (Form_pg_type) GETSTRUCT(typtup);
visible = true;
break;
}
- if (SearchSysCacheExists(TYPENAMENSP,
- PointerGetDatum(typname),
- ObjectIdGetDatum(namespaceId),
- 0, 0))
+ if (SearchSysCacheExists2(TYPENAMENSP,
+ PointerGetDatum(typname),
+ ObjectIdGetDatum(namespaceId)))
{
/* Found something else first in path */
break;
}
/* Search syscache by name only */
- catlist = SearchSysCacheList(PROCNAMEARGSNSP, 1,
- CStringGetDatum(funcname),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(PROCNAMEARGSNSP, CStringGetDatum(funcname));
for (i = 0; i < catlist->n_members; i++)
{
Oid pronamespace;
bool visible;
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
procform = (Form_pg_proc) GETSTRUCT(proctup);
HeapTuple opertup;
namespaceId = LookupExplicitNamespace(schemaname);
- opertup = SearchSysCache(OPERNAMENSP,
- CStringGetDatum(opername),
- ObjectIdGetDatum(oprleft),
- ObjectIdGetDatum(oprright),
- ObjectIdGetDatum(namespaceId));
+ opertup = SearchSysCache4(OPERNAMENSP,
+ CStringGetDatum(opername),
+ ObjectIdGetDatum(oprleft),
+ ObjectIdGetDatum(oprright),
+ ObjectIdGetDatum(namespaceId));
if (HeapTupleIsValid(opertup))
{
Oid result = HeapTupleGetOid(opertup);
}
/* Search syscache by name and argument types */
- catlist = SearchSysCacheList(OPERNAMENSP, 3,
- CStringGetDatum(opername),
- ObjectIdGetDatum(oprleft),
- ObjectIdGetDatum(oprright),
- 0);
+ catlist = SearchSysCacheList3(OPERNAMENSP,
+ CStringGetDatum(opername),
+ ObjectIdGetDatum(oprleft),
+ ObjectIdGetDatum(oprright));
if (catlist->n_members == 0)
{
}
/* Search syscache by name only */
- catlist = SearchSysCacheList(OPERNAMENSP, 1,
- CStringGetDatum(opername),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(OPERNAMENSP, CStringGetDatum(opername));
/*
* In typical scenarios, most if not all of the operators found by the
Oid oprnamespace;
bool visible;
- oprtup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(oprid),
- 0, 0, 0);
+ oprtup = SearchSysCache1(OPEROID, ObjectIdGetDatum(oprid));
if (!HeapTupleIsValid(oprtup))
elog(ERROR, "cache lookup failed for operator %u", oprid);
oprform = (Form_pg_operator) GETSTRUCT(oprtup);
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- opcid = GetSysCacheOid(CLAAMNAMENSP,
- ObjectIdGetDatum(amid),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ opcid = GetSysCacheOid3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amid),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(opcid))
return opcid;
}
Oid opcnamespace;
bool visible;
- opctup = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opcid),
- 0, 0, 0);
+ opctup = SearchSysCache1(CLAOID, ObjectIdGetDatum(opcid));
if (!HeapTupleIsValid(opctup))
elog(ERROR, "cache lookup failed for opclass %u", opcid);
opcform = (Form_pg_opclass) GETSTRUCT(opctup);
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- opfid = GetSysCacheOid(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amid),
- PointerGetDatum(opfname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ opfid = GetSysCacheOid3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amid),
+ PointerGetDatum(opfname),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(opfid))
return opfid;
}
Oid opfnamespace;
bool visible;
- opftup = SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opfid),
- 0, 0, 0);
+ opftup = SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opfid));
if (!HeapTupleIsValid(opftup))
elog(ERROR, "cache lookup failed for opfamily %u", opfid);
opfform = (Form_pg_opfamily) GETSTRUCT(opftup);
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- conid = GetSysCacheOid(CONNAMENSP,
- PointerGetDatum(conname),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ conid = GetSysCacheOid2(CONNAMENSP,
+ PointerGetDatum(conname),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(conid))
return conid;
}
Oid connamespace;
bool visible;
- contup = SearchSysCache(CONVOID,
- ObjectIdGetDatum(conid),
- 0, 0, 0);
+ contup = SearchSysCache1(CONVOID, ObjectIdGetDatum(conid));
if (!HeapTupleIsValid(contup))
elog(ERROR, "cache lookup failed for conversion %u", conid);
conform = (Form_pg_conversion) GETSTRUCT(contup);
{
/* use exact schema given */
namespaceId = LookupExplicitNamespace(schemaname);
- prsoid = GetSysCacheOid(TSPARSERNAMENSP,
- PointerGetDatum(parser_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ prsoid = GetSysCacheOid2(TSPARSERNAMENSP,
+ PointerGetDatum(parser_name),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- prsoid = GetSysCacheOid(TSPARSERNAMENSP,
- PointerGetDatum(parser_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ prsoid = GetSysCacheOid2(TSPARSERNAMENSP,
+ PointerGetDatum(parser_name),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(prsoid))
break;
}
Oid namespace;
bool visible;
- tup = SearchSysCache(TSPARSEROID,
- ObjectIdGetDatum(prsId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSPARSEROID, ObjectIdGetDatum(prsId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search parser %u", prsId);
form = (Form_pg_ts_parser) GETSTRUCT(tup);
visible = true;
break;
}
- if (SearchSysCacheExists(TSPARSERNAMENSP,
- PointerGetDatum(name),
- ObjectIdGetDatum(namespaceId),
- 0, 0))
+ if (SearchSysCacheExists2(TSPARSERNAMENSP,
+ PointerGetDatum(name),
+ ObjectIdGetDatum(namespaceId)))
{
/* Found something else first in path */
break;
{
/* use exact schema given */
namespaceId = LookupExplicitNamespace(schemaname);
- dictoid = GetSysCacheOid(TSDICTNAMENSP,
- PointerGetDatum(dict_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ dictoid = GetSysCacheOid2(TSDICTNAMENSP,
+ PointerGetDatum(dict_name),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- dictoid = GetSysCacheOid(TSDICTNAMENSP,
- PointerGetDatum(dict_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ dictoid = GetSysCacheOid2(TSDICTNAMENSP,
+ PointerGetDatum(dict_name),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(dictoid))
break;
}
Oid namespace;
bool visible;
- tup = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dictId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dictId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search dictionary %u",
dictId);
visible = true;
break;
}
- if (SearchSysCacheExists(TSDICTNAMENSP,
- PointerGetDatum(name),
- ObjectIdGetDatum(namespaceId),
- 0, 0))
+ if (SearchSysCacheExists2(TSDICTNAMENSP,
+ PointerGetDatum(name),
+ ObjectIdGetDatum(namespaceId)))
{
/* Found something else first in path */
break;
{
/* use exact schema given */
namespaceId = LookupExplicitNamespace(schemaname);
- tmploid = GetSysCacheOid(TSTEMPLATENAMENSP,
- PointerGetDatum(template_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ tmploid = GetSysCacheOid2(TSTEMPLATENAMENSP,
+ PointerGetDatum(template_name),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- tmploid = GetSysCacheOid(TSTEMPLATENAMENSP,
- PointerGetDatum(template_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ tmploid = GetSysCacheOid2(TSTEMPLATENAMENSP,
+ PointerGetDatum(template_name),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(tmploid))
break;
}
Oid namespace;
bool visible;
- tup = SearchSysCache(TSTEMPLATEOID,
- ObjectIdGetDatum(tmplId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSTEMPLATEOID, ObjectIdGetDatum(tmplId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search template %u", tmplId);
form = (Form_pg_ts_template) GETSTRUCT(tup);
visible = true;
break;
}
- if (SearchSysCacheExists(TSTEMPLATENAMENSP,
- PointerGetDatum(name),
- ObjectIdGetDatum(namespaceId),
- 0, 0))
+ if (SearchSysCacheExists2(TSTEMPLATENAMENSP,
+ PointerGetDatum(name),
+ ObjectIdGetDatum(namespaceId)))
{
/* Found something else first in path */
break;
{
/* use exact schema given */
namespaceId = LookupExplicitNamespace(schemaname);
- cfgoid = GetSysCacheOid(TSCONFIGNAMENSP,
- PointerGetDatum(config_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ cfgoid = GetSysCacheOid2(TSCONFIGNAMENSP,
+ PointerGetDatum(config_name),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- cfgoid = GetSysCacheOid(TSCONFIGNAMENSP,
- PointerGetDatum(config_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ cfgoid = GetSysCacheOid2(TSCONFIGNAMENSP,
+ PointerGetDatum(config_name),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(cfgoid))
break;
}
Oid namespace;
bool visible;
- tup = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfgid),
- 0, 0, 0);
+ tup = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search configuration %u",
cfgid);
visible = true;
break;
}
- if (SearchSysCacheExists(TSCONFIGNAMENSP,
- PointerGetDatum(name),
- ObjectIdGetDatum(namespaceId),
- 0, 0))
+ if (SearchSysCacheExists2(TSCONFIGNAMENSP,
+ PointerGetDatum(name),
+ ObjectIdGetDatum(namespaceId)))
{
/* Found something else first in path */
break;
return InvalidOid;
}
- return GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(nspname),
- 0, 0, 0);
+ return GetSysCacheOid1(NAMESPACENAME, CStringGetDatum(nspname));
}
/*
*/
}
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(nspname),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME, CStringGetDatum(nspname));
if (!OidIsValid(namespaceId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
return myTempNamespace;
}
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(nspname),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME, CStringGetDatum(nspname));
if (!OidIsValid(namespaceId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
return myTempNamespace;
}
/* use exact schema given */
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(schemaname),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(schemaname));
if (!OidIsValid(namespaceId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
{
/* use exact schema given */
namespaceId = LookupExplicitNamespace(schemaname);
- return GetSysCacheOid(CONNAMENSP,
- PointerGetDatum(conversion_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ return GetSysCacheOid2(CONNAMENSP,
+ PointerGetDatum(conversion_name),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (namespaceId == myTempNamespace)
continue; /* do not look in temp namespace */
- conoid = GetSysCacheOid(CONNAMENSP,
- PointerGetDatum(conversion_name),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ conoid = GetSysCacheOid2(CONNAMENSP,
+ PointerGetDatum(conversion_name),
+ ObjectIdGetDatum(namespaceId));
if (OidIsValid(conoid))
return conoid;
}
/* $user --- substitute namespace matching user name, if any */
HeapTuple tuple;
- tuple = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(roleid),
- 0, 0, 0);
+ tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
if (HeapTupleIsValid(tuple))
{
char *rname;
rname = NameStr(((Form_pg_authid) GETSTRUCT(tuple))->rolname);
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(rname),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(rname));
ReleaseSysCache(tuple);
if (OidIsValid(namespaceId) &&
!list_member_oid(oidlist, namespaceId) &&
else
{
/* normal namespace reference */
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(curname),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(curname));
if (OidIsValid(namespaceId) &&
!list_member_oid(oidlist, namespaceId) &&
pg_namespace_aclcheck(namespaceId, roleid,
snprintf(namespaceName, sizeof(namespaceName), "pg_temp_%d", MyBackendId);
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(namespaceName),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(namespaceName));
if (!OidIsValid(namespaceId))
{
/*
snprintf(namespaceName, sizeof(namespaceName), "pg_toast_temp_%d",
MyBackendId);
- toastspaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(namespaceName),
- 0, 0, 0);
+ toastspaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(namespaceName));
if (!OidIsValid(toastspaceId))
{
toastspaceId = NamespaceCreate(namespaceName, BOOTSTRAP_SUPERUSERID);
continue;
if (strcmp(curname, "pg_temp") == 0)
continue;
- if (!SearchSysCacheExists(NAMESPACENAME,
- CStringGetDatum(curname),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(NAMESPACENAME,
+ CStringGetDatum(curname)))
ereport((source == PGC_S_TEST) ? NOTICE : ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
errmsg("schema \"%s\" does not exist", curname)));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(RelationIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(TYPEOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(TYPEOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(TypeIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(PROCOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(PROCOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(FunctionIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(OPEROID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(OPEROID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(OperatorIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(CLAOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(CLAOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(OpclassIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(CONVOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(CONVOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(ConversionIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(TSPARSEROID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(TSPARSEROID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(TSParserIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(TSDICTOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(TSDICTOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(TSDictionaryIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(TSTEMPLATEOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(TSTEMPLATEOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(TSTemplateIsVisible(oid));
{
Oid oid = PG_GETARG_OID(0);
- if (!SearchSysCacheExists(TSCONFIGOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(TSCONFIGOID, ObjectIdGetDatum(oid)))
PG_RETURN_NULL();
PG_RETURN_BOOL(TSConfigIsVisible(oid));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.104 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.105 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
NameListToString(aggtransfnName),
format_type_be(aggTransType))));
- tup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(transfn),
- 0, 0, 0);
+ tup = SearchSysCache1(PROCOID, ObjectIdGetDatum(transfn));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for function %u", transfn);
proc = (Form_pg_proc) GETSTRUCT(tup);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.51 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.52 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
conDesc = heap_open(ConstraintRelationId, RowExclusiveLock);
- tup = SearchSysCache(CONSTROID,
- ObjectIdGetDatum(conId),
- 0, 0, 0);
+ tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(conId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for constraint %u", conId);
con = (Form_pg_constraint) GETSTRUCT(tup);
Form_pg_class classForm;
pgrel = heap_open(RelationRelationId, RowExclusiveLock);
- relTup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(con->conrelid),
- 0, 0, 0);
+ relTup = SearchSysCacheCopy1(RELOID,
+ ObjectIdGetDatum(con->conrelid));
if (!HeapTupleIsValid(relTup))
elog(ERROR, "cache lookup failed for relation %u",
con->conrelid);
conDesc = heap_open(ConstraintRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(CONSTROID,
- ObjectIdGetDatum(conId),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(CONSTROID, ObjectIdGetDatum(conId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for constraint %u", conId);
con = (Form_pg_constraint) GETSTRUCT(tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.49 2010/02/02 18:52:33 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.50 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "no conversion name supplied");
/* make sure there is no existing conversion of same name */
- if (SearchSysCacheExists(CONNAMENSP,
- PointerGetDatum(conname),
- ObjectIdGetDatum(connamespace),
- 0, 0))
+ if (SearchSysCacheExists2(CONNAMENSP,
+ PointerGetDatum(conname),
+ ObjectIdGetDatum(connamespace)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("conversion \"%s\" already exists", conname)));
Oid proc = InvalidOid;
int i;
- catlist = SearchSysCacheList(CONDEFAULT, 3,
- ObjectIdGetDatum(name_space),
- Int32GetDatum(for_encoding),
- Int32GetDatum(to_encoding),
- 0);
+ catlist = SearchSysCacheList3(CONDEFAULT,
+ ObjectIdGetDatum(name_space),
+ Int32GetDatum(for_encoding),
+ Int32GetDatum(to_encoding));
for (i = 0; i < catlist->n_members; i++)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_inherits.c,v 1.6 2010/02/01 19:28:56 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_inherits.c,v 1.7 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* really exists or not. If not, assume it was dropped while we
* waited to acquire lock, and ignore it.
*/
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(inhrelid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(inhrelid)))
{
/* Release useless lock */
UnlockRelationOid(inhrelid, lockmode);
HeapTuple tuple;
bool result;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relationId),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relationId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relationId);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_namespace.c,v 1.22 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_namespace.c,v 1.23 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "no namespace name supplied");
/* make sure there is no existing namespace of same name */
- if (SearchSysCacheExists(NAMESPACENAME,
- PointerGetDatum(nspName),
- 0, 0, 0))
+ if (SearchSysCacheExists1(NAMESPACENAME, PointerGetDatum(nspName)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_SCHEMA),
errmsg("schema \"%s\" already exists", nspName)));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_operator.c,v 1.110 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_operator.c,v 1.111 2010/02/14 18:42:13 rhaas Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
HeapTuple tup;
Oid operatorObjectId;
- tup = SearchSysCache(OPERNAMENSP,
- PointerGetDatum(operatorName),
- ObjectIdGetDatum(leftObjectId),
- ObjectIdGetDatum(rightObjectId),
- ObjectIdGetDatum(operatorNamespace));
+ tup = SearchSysCache4(OPERNAMENSP,
+ PointerGetDatum(operatorName),
+ ObjectIdGetDatum(leftObjectId),
+ ObjectIdGetDatum(rightObjectId),
+ ObjectIdGetDatum(operatorNamespace));
if (HeapTupleIsValid(tup))
{
RegProcedure oprcode = ((Form_pg_operator) GETSTRUCT(tup))->oprcode;
*/
if (operatorObjectId)
{
- tup = SearchSysCacheCopy(OPEROID,
- ObjectIdGetDatum(operatorObjectId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(OPEROID,
+ ObjectIdGetDatum(operatorObjectId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for operator %u",
operatorObjectId);
pg_operator_desc = heap_open(OperatorRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(OPEROID,
- ObjectIdGetDatum(commId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(OPEROID, ObjectIdGetDatum(commId));
/*
* if the commutator and negator are the same operator, do one update. XXX
/* check and update the negator, if necessary */
- tup = SearchSysCacheCopy(OPEROID,
- ObjectIdGetDatum(negId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(OPEROID, ObjectIdGetDatum(negId));
if (HeapTupleIsValid(tup) &&
!(OidIsValid(((Form_pg_operator) GETSTRUCT(tup))->oprnegate)))
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.170 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.171 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
tupDesc = RelationGetDescr(rel);
/* Check for pre-existing definition */
- oldtup = SearchSysCache(PROCNAMEARGSNSP,
- PointerGetDatum(procedureName),
- PointerGetDatum(parameterTypes),
- ObjectIdGetDatum(procNamespace),
- 0);
+ oldtup = SearchSysCache3(PROCNAMEARGSNSP,
+ PointerGetDatum(procedureName),
+ PointerGetDatum(parameterTypes),
+ ObjectIdGetDatum(procNamespace));
if (HeapTupleIsValid(oldtup))
{
* name will be found later if it isn't there now.
*/
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcoid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcoid);
proc = (Form_pg_proc) GETSTRUCT(tuple);
* and for pg_dump loading it's much better if we *do* check.
*/
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcoid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcoid);
proc = (Form_pg_proc) GETSTRUCT(tuple);
bool haspolyarg;
int i;
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcoid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcoid);
proc = (Form_pg_proc) GETSTRUCT(tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.38 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.39 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
switch (classId)
{
case AuthIdRelationId:
- if (!SearchSysCacheExists(AUTHOID,
- ObjectIdGetDatum(objectId),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(AUTHOID, ObjectIdGetDatum(objectId)))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("role %u was concurrently dropped",
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.131 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.132 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
*/
pg_type_desc = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPENAMENSP,
- CStringGetDatum(typeName),
- ObjectIdGetDatum(typeNamespace),
- 0, 0);
+ tup = SearchSysCacheCopy2(TYPENAMENSP,
+ CStringGetDatum(typeName),
+ ObjectIdGetDatum(typeNamespace));
if (HeapTupleIsValid(tup))
{
/*
pg_type_desc = heap_open(TypeRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for type %u", typeOid);
typ = (Form_pg_type) GETSTRUCT(tuple);
arrayOid = typ->typarray;
/* Just to give a more friendly error than unique-index violation */
- if (SearchSysCacheExists(TYPENAMENSP,
- CStringGetDatum(newTypeName),
- ObjectIdGetDatum(typeNamespace),
- 0, 0))
+ if (SearchSysCacheExists2(TYPENAMENSP,
+ CStringGetDatum(newTypeName),
+ ObjectIdGetDatum(typeNamespace)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("type \"%s\" already exists", newTypeName)));
memcpy(arr + i, typeName, NAMEDATALEN - i);
truncate_identifier(arr, NAMEDATALEN, false);
}
- if (!SearchSysCacheExists(TYPENAMENSP,
- CStringGetDatum(arr),
- ObjectIdGetDatum(typeNamespace),
- 0, 0))
+ if (!SearchSysCacheExists2(TYPENAMENSP,
+ CStringGetDatum(arr),
+ ObjectIdGetDatum(typeNamespace)))
break;
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/toasting.c,v 1.30 2010/02/07 20:48:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/toasting.c,v 1.31 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
*/
class_rel = heap_open(RelationRelationId, RowExclusiveLock);
- reltup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relOid),
- 0, 0, 0);
+ reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relOid));
if (!HeapTupleIsValid(reltup))
elog(ERROR, "cache lookup failed for relation %u", relOid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.51 2010/01/02 16:57:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.52 2010/02/14 18:42:13 rhaas Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
/*
* Find the function tuple, do permissions and validity checks
*/
- tup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(procOid),
- 0, 0, 0);
+ tup = SearchSysCache1(PROCOID, ObjectIdGetDatum(procOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", procOid);
/* Look up function and make sure it's an aggregate */
procOid = LookupAggNameTypeNames(name, args, false);
- tup = SearchSysCacheCopy(PROCOID,
- ObjectIdGetDatum(procOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(procOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", procOid);
procForm = (Form_pg_proc) GETSTRUCT(tup);
namespaceOid = procForm->pronamespace;
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(PROCNAMEARGSNSP,
- CStringGetDatum(newname),
- PointerGetDatum(&procForm->proargtypes),
- ObjectIdGetDatum(namespaceOid),
- 0))
+ if (SearchSysCacheExists3(PROCNAMEARGSNSP,
+ CStringGetDatum(newname),
+ PointerGetDatum(&procForm->proargtypes),
+ ObjectIdGetDatum(namespaceOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_FUNCTION),
errmsg("function %s already exists in schema \"%s\"",
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.150 2010/02/08 04:33:53 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.151 2010/02/14 18:42:13 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
stats = (VacAttrStats *) palloc0(sizeof(VacAttrStats));
stats->attr = (Form_pg_attribute) palloc(ATTRIBUTE_FIXED_PART_SIZE);
memcpy(stats->attr, attr, ATTRIBUTE_FIXED_PART_SIZE);
- typtuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(attr->atttypid),
- 0, 0, 0);
+ typtuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(attr->atttypid));
if (!HeapTupleIsValid(typtuple))
elog(ERROR, "cache lookup failed for type %u", attr->atttypid);
stats->attrtype = (Form_pg_type) palloc(sizeof(FormData_pg_type));
}
/* Is there already a pg_statistic tuple for this attribute? */
- oldtup = SearchSysCache(STATRELATTINH,
- ObjectIdGetDatum(relid),
- Int16GetDatum(stats->attr->attnum),
- BoolGetDatum(inh),
- 0);
+ oldtup = SearchSysCache3(STATRELATTINH,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(stats->attr->attnum),
+ BoolGetDatum(inh));
if (HeapTupleIsValid(oldtup))
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.200 2010/02/09 21:43:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.201 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
Form_pg_index indexForm;
indexOid = lfirst_oid(index);
- idxtuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexOid),
- 0, 0, 0);
+ idxtuple = SearchSysCache1(INDEXRELID,
+ ObjectIdGetDatum(indexOid));
if (!HeapTupleIsValid(idxtuple))
elog(ERROR, "cache lookup failed for index %u", indexOid);
indexForm = (Form_pg_index) GETSTRUCT(idxtuple);
/*
* Check that the index still exists
*/
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(indexOid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(indexOid)))
{
relation_close(OldHeap, AccessExclusiveLock);
return;
/*
* Check that the index is still the one with indisclustered set.
*/
- tuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexOid));
if (!HeapTupleIsValid(tuple)) /* probably can't happen */
{
relation_close(OldHeap, AccessExclusiveLock);
*/
if (OidIsValid(indexOid))
{
- indexTuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexOid),
- 0, 0, 0);
+ indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexOid));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexOid);
indexForm = (Form_pg_index) GETSTRUCT(indexTuple);
{
Oid thisIndexOid = lfirst_oid(index);
- indexTuple = SearchSysCacheCopy(INDEXRELID,
- ObjectIdGetDatum(thisIndexOid),
- 0, 0, 0);
+ indexTuple = SearchSysCacheCopy1(INDEXRELID,
+ ObjectIdGetDatum(thisIndexOid));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", thisIndexOid);
indexForm = (Form_pg_index) GETSTRUCT(indexTuple);
/*
* But we do want to use reloptions of the old heap for new heap.
*/
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(OIDOldHeap),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(OIDOldHeap));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", OIDOldHeap);
reloptions = SysCacheGetAttr(RELOID, tuple, Anum_pg_class_reloptions,
if (OidIsValid(toastid))
{
/* keep the existing toast table's reloptions, if any */
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(toastid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(toastid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", toastid);
reloptions = SysCacheGetAttr(RELOID, tuple, Anum_pg_class_reloptions,
/* We need writable copies of both pg_class tuples. */
relRelation = heap_open(RelationRelationId, RowExclusiveLock);
- reltup1 = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(r1),
- 0, 0, 0);
+ reltup1 = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(r1));
if (!HeapTupleIsValid(reltup1))
elog(ERROR, "cache lookup failed for relation %u", r1);
relform1 = (Form_pg_class) GETSTRUCT(reltup1);
- reltup2 = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(r2),
- 0, 0, 0);
+ reltup2 = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(r2));
if (!HeapTupleIsValid(reltup2))
elog(ERROR, "cache lookup failed for relation %u", r2);
relform2 = (Form_pg_class) GETSTRUCT(reltup2);
* Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.112 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.113 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
errmsg("schema name cannot be qualified")));
namespace = strVal(linitial(qualname));
- oid = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(namespace),
- 0, 0, 0);
+ oid = GetSysCacheOid1(NAMESPACENAME, CStringGetDatum(namespace));
if (!OidIsValid(oid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
reloid = RelationGetRelid(relation);
/* Find the rule's pg_rewrite tuple, get its OID */
- tuple = SearchSysCache(RULERELNAME,
- ObjectIdGetDatum(reloid),
- PointerGetDatum(rulename),
- 0, 0);
+ tuple = SearchSysCache2(RULERELNAME,
+ ObjectIdGetDatum(reloid),
+ PointerGetDatum(rulename));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("language name cannot be qualified")));
language = strVal(linitial(qualname));
- oid = GetSysCacheOid(LANGNAME,
- CStringGetDatum(language),
- 0, 0, 0);
+ oid = GetSysCacheOid1(LANGNAME, CStringGetDatum(language));
if (!OidIsValid(oid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
/*
* Get the access method's OID.
*/
- amID = GetSysCacheOid(AMNAME,
- CStringGetDatum(amname),
- 0, 0, 0);
+ amID = GetSysCacheOid1(AMNAME, CStringGetDatum(amname));
if (!OidIsValid(amID))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- tuple = SearchSysCache(CLAAMNAMENSP,
- ObjectIdGetDatum(amID),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ tuple = SearchSysCache3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amID),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator class \"%s\" does not exist for access method \"%s\"",
opcname, amname)));
- tuple = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opcID),
- 0, 0, 0);
+ tuple = SearchSysCache1(CLAOID, ObjectIdGetDatum(opcID));
}
if (!HeapTupleIsValid(tuple))
/*
* Get the access method's OID.
*/
- amID = GetSysCacheOid(AMNAME,
- CStringGetDatum(amname),
- 0, 0, 0);
+ amID = GetSysCacheOid1(AMNAME, CStringGetDatum(amname));
if (!OidIsValid(amID))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- tuple = SearchSysCache(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amID),
- PointerGetDatum(opfname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ tuple = SearchSysCache3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amID),
+ PointerGetDatum(opfname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator family \"%s\" does not exist for access method \"%s\"",
opfname, amname)));
- tuple = SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opfID),
- 0, 0, 0);
+ tuple = SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opfID));
}
if (!HeapTupleIsValid(tuple))
sourcetypeid = typenameTypeId(NULL, sourcetype, NULL);
targettypeid = typenameTypeId(NULL, targettype, NULL);
- tuple = SearchSysCache(CASTSOURCETARGET,
- ObjectIdGetDatum(sourcetypeid),
- ObjectIdGetDatum(targettypeid),
- 0, 0);
+ tuple = SearchSysCache2(CASTSOURCETARGET,
+ ObjectIdGetDatum(sourcetypeid),
+ ObjectIdGetDatum(targettypeid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.40 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.41 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
continue;
}
- tuple = SearchSysCache(CONVOID,
- ObjectIdGetDatum(conversionOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(CONVOID, ObjectIdGetDatum(conversionOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for conversion %u",
conversionOid);
errmsg("conversion \"%s\" does not exist",
NameListToString(name))));
- tup = SearchSysCacheCopy(CONVOID,
- ObjectIdGetDatum(conversionOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(CONVOID, ObjectIdGetDatum(conversionOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for conversion %u", conversionOid);
namespaceOid = ((Form_pg_conversion) GETSTRUCT(tup))->connamespace;
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(CONNAMENSP,
- CStringGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0, 0))
+ if (SearchSysCacheExists2(CONNAMENSP,
+ CStringGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("conversion \"%s\" already exists in schema \"%s\"",
Assert(RelationGetRelid(rel) == ConversionRelationId);
- tup = SearchSysCacheCopy(CONVOID,
- ObjectIdGetDatum(conversionOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(CONVOID, ObjectIdGetDatum(conversionOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for conversion %u", conversionOid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.233 2010/01/16 14:16:31 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.234 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Remove the database's tuple from pg_database.
*/
- tup = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(db_id),
- 0, 0, 0);
+ tup = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(db_id));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for database %u", db_id);
errdetail_busy_db(notherbackends, npreparedxacts)));
/* rename */
- newtup = SearchSysCacheCopy(DATABASEOID,
- ObjectIdGetDatum(db_id),
- 0, 0, 0);
+ newtup = SearchSysCacheCopy1(DATABASEOID, ObjectIdGetDatum(db_id));
if (!HeapTupleIsValid(newtup))
elog(ERROR, "cache lookup failed for database %u", db_id);
namestrcpy(&(((Form_pg_database) GETSTRUCT(newtup))->datname), newname);
* the same name, we win; else, drop the lock and loop back to try
* again.
*/
- tuple = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(dbOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(dbOid));
if (HeapTupleIsValid(tuple))
{
Form_pg_database dbform = (Form_pg_database) GETSTRUCT(tuple);
if (superuser())
return true;
- utup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(GetUserId()),
- 0, 0, 0);
+ utup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(GetUserId()));
if (HeapTupleIsValid(utup))
{
result = ((Form_pg_authid) GETSTRUCT(utup))->rolcreatedb;
HeapTuple dbtuple;
char *result;
- dbtuple = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(dbid),
- 0, 0, 0);
+ dbtuple = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(dbid));
if (HeapTupleIsValid(dbtuple))
{
result = pstrdup(NameStr(((Form_pg_database) GETSTRUCT(dbtuple))->datname));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/foreigncmds.c,v 1.10 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/foreigncmds.c,v 1.11 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
rel = heap_open(ForeignDataWrapperRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(FOREIGNDATAWRAPPERNAME,
- CStringGetDatum(name),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(FOREIGNDATAWRAPPERNAME, CStringGetDatum(name));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
rel = heap_open(ForeignServerRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(FOREIGNSERVERNAME,
- CStringGetDatum(name),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(FOREIGNSERVERNAME, CStringGetDatum(name));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
stmt->fdwname),
errhint("Must be superuser to alter a foreign-data wrapper.")));
- tp = SearchSysCacheCopy(FOREIGNDATAWRAPPERNAME,
- CStringGetDatum(stmt->fdwname),
- 0, 0, 0);
+ tp = SearchSysCacheCopy1(FOREIGNDATAWRAPPERNAME,
+ CStringGetDatum(stmt->fdwname));
if (!HeapTupleIsValid(tp))
ereport(ERROR,
rel = heap_open(ForeignDataWrapperRelationId, RowExclusiveLock);
- tp = SearchSysCache(FOREIGNDATAWRAPPEROID,
- ObjectIdGetDatum(fdwId),
- 0, 0, 0);
+ tp = SearchSysCache1(FOREIGNDATAWRAPPEROID, ObjectIdGetDatum(fdwId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for foreign-data wrapper %u", fdwId);
Oid srvId;
Form_pg_foreign_server srvForm;
- tp = SearchSysCacheCopy(FOREIGNSERVERNAME,
- CStringGetDatum(stmt->servername),
- 0, 0, 0);
+ tp = SearchSysCacheCopy1(FOREIGNSERVERNAME,
+ CStringGetDatum(stmt->servername));
if (!HeapTupleIsValid(tp))
ereport(ERROR,
rel = heap_open(ForeignServerRelationId, RowExclusiveLock);
- tp = SearchSysCache(FOREIGNSERVEROID,
- ObjectIdGetDatum(srvId),
- 0, 0, 0);
+ tp = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(srvId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for foreign server %u", srvId);
/*
* Check that the user mapping is unique within server.
*/
- umId = GetSysCacheOid(USERMAPPINGUSERSERVER,
- ObjectIdGetDatum(useId),
- ObjectIdGetDatum(srv->serverid),
- 0, 0);
+ umId = GetSysCacheOid2(USERMAPPINGUSERSERVER,
+ ObjectIdGetDatum(useId),
+ ObjectIdGetDatum(srv->serverid));
if (OidIsValid(umId))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
useId = GetUserOidFromMapping(stmt->username, false);
srv = GetForeignServerByName(stmt->servername, false);
- umId = GetSysCacheOid(USERMAPPINGUSERSERVER,
- ObjectIdGetDatum(useId),
- ObjectIdGetDatum(srv->serverid),
- 0, 0);
+ umId = GetSysCacheOid2(USERMAPPINGUSERSERVER,
+ ObjectIdGetDatum(useId),
+ ObjectIdGetDatum(srv->serverid));
if (!OidIsValid(umId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
user_mapping_ddl_aclcheck(useId, srv->serverid, stmt->servername);
- tp = SearchSysCacheCopy(USERMAPPINGOID,
- ObjectIdGetDatum(umId),
- 0, 0, 0);
+ tp = SearchSysCacheCopy1(USERMAPPINGOID, ObjectIdGetDatum(umId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for user mapping %u", umId);
return;
}
- umId = GetSysCacheOid(USERMAPPINGUSERSERVER,
- ObjectIdGetDatum(useId),
- ObjectIdGetDatum(srv->serverid),
- 0, 0);
+ umId = GetSysCacheOid2(USERMAPPINGUSERSERVER,
+ ObjectIdGetDatum(useId),
+ ObjectIdGetDatum(srv->serverid));
if (!OidIsValid(umId))
{
rel = heap_open(UserMappingRelationId, RowExclusiveLock);
- tp = SearchSysCache(USERMAPPINGOID,
- ObjectIdGetDatum(umId),
- 0, 0, 0);
+ tp = SearchSysCache1(USERMAPPINGOID, ObjectIdGetDatum(umId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for user mapping %u", umId);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.115 2010/01/26 16:33:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.116 2010/02/14 18:42:14 rhaas Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
languageName = case_translate_language_name(language);
/* Look up the language and validate permissions */
- languageTuple = SearchSysCache(LANGNAME,
- PointerGetDatum(languageName),
- 0, 0, 0);
+ languageTuple = SearchSysCache1(LANGNAME, PointerGetDatum(languageName));
if (!HeapTupleIsValid(languageTuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
return;
}
- tup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ tup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", funcOid);
*/
relation = heap_open(ProcedureRelationId, RowExclusiveLock);
- tup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ tup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", funcOid);
{
relation = heap_open(AggregateRelationId, RowExclusiveLock);
- tup = SearchSysCache(AGGFNOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for pg_aggregate tuple for function %u", funcOid);
procOid = LookupFuncNameTypeNames(name, argtypes, false);
- tup = SearchSysCacheCopy(PROCOID,
- ObjectIdGetDatum(procOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(procOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", procOid);
procForm = (Form_pg_proc) GETSTRUCT(tup);
namespaceOid = procForm->pronamespace;
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(PROCNAMEARGSNSP,
- CStringGetDatum(newname),
- PointerGetDatum(&procForm->proargtypes),
- ObjectIdGetDatum(namespaceOid),
- 0))
+ if (SearchSysCacheExists3(PROCNAMEARGSNSP,
+ CStringGetDatum(newname),
+ PointerGetDatum(&procForm->proargtypes),
+ ObjectIdGetDatum(namespaceOid)))
{
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_FUNCTION),
procOid = LookupFuncNameTypeNames(name, argtypes, false);
- tup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(procOid),
- 0, 0, 0);
+ tup = SearchSysCache1(PROCOID, ObjectIdGetDatum(procOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", procOid);
rel = heap_open(ProcedureRelationId, RowExclusiveLock);
- tup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(procOid),
- 0, 0, 0);
+ tup = SearchSysCache1(PROCOID, ObjectIdGetDatum(procOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", procOid);
AlterFunctionOwner_internal(rel, tup, newOwnerId);
stmt->func->funcargs,
false);
- tup = SearchSysCacheCopy(PROCOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", funcOid);
pg_proc_rel = heap_open(ProcedureRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(PROCOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", funcOid);
procForm = (Form_pg_proc) GETSTRUCT(tup);
pg_proc_rel = heap_open(ProcedureRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(PROCOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for function %u", funcOid);
procForm = (Form_pg_proc) GETSTRUCT(tup);
stmt->func->funcargs,
false);
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcid);
* the unique index would catch it anyway (so no need to sweat about race
* conditions).
*/
- tuple = SearchSysCache(CASTSOURCETARGET,
- ObjectIdGetDatum(sourcetypeid),
- ObjectIdGetDatum(targettypeid),
- 0, 0);
+ tuple = SearchSysCache2(CASTSOURCETARGET,
+ ObjectIdGetDatum(sourcetypeid),
+ ObjectIdGetDatum(targettypeid));
if (HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
sourcetypeid = typenameTypeId(NULL, stmt->sourcetype, NULL);
targettypeid = typenameTypeId(NULL, stmt->targettype, NULL);
- tuple = SearchSysCache(CASTSOURCETARGET,
- ObjectIdGetDatum(sourcetypeid),
- ObjectIdGetDatum(targettypeid),
- 0, 0);
+ tuple = SearchSysCache2(CASTSOURCETARGET,
+ ObjectIdGetDatum(sourcetypeid),
+ ObjectIdGetDatum(targettypeid));
if (!HeapTupleIsValid(tuple))
{
if (!stmt->missing_ok)
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_PROC,
NameListToString(name));
- tup = SearchSysCacheCopy(PROCOID,
- ObjectIdGetDatum(procOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(procOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for function %u", procOid);
proc = (Form_pg_proc) GETSTRUCT(tup);
errmsg("cannot move objects into or out of TOAST schema")));
/* check for duplicate name (more friendly than unique-index failure) */
- if (SearchSysCacheExists(PROCNAMEARGSNSP,
- CStringGetDatum(NameStr(proc->proname)),
- PointerGetDatum(&proc->proargtypes),
- ObjectIdGetDatum(nspOid),
- 0))
+ if (SearchSysCacheExists3(PROCNAMEARGSNSP,
+ CStringGetDatum(NameStr(proc->proname)),
+ PointerGetDatum(&proc->proargtypes),
+ ObjectIdGetDatum(nspOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_FUNCTION),
errmsg("function \"%s\" already exists in schema \"%s\"",
languageName = case_translate_language_name(language);
/* Look up the language and validate permissions */
- languageTuple = SearchSysCache(LANGNAME,
- PointerGetDatum(languageName),
- 0, 0, 0);
+ languageTuple = SearchSysCache1(LANGNAME, PointerGetDatum(languageName));
if (!HeapTupleIsValid(languageTuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.192 2010/02/07 22:40:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.193 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* look up the access method, verify it can handle the requested features
*/
- tuple = SearchSysCache(AMNAME,
- PointerGetDatum(accessMethodName),
- 0, 0, 0);
+ tuple = SearchSysCache1(AMNAME, PointerGetDatum(accessMethodName));
if (!HeapTupleIsValid(tuple))
{
/*
ereport(NOTICE,
(errmsg("substituting access method \"gist\" for obsolete method \"rtree\"")));
accessMethodName = "gist";
- tuple = SearchSysCache(AMNAME,
- PointerGetDatum(accessMethodName),
- 0, 0, 0);
+ tuple = SearchSysCache1(AMNAME, PointerGetDatum(accessMethodName));
}
if (!HeapTupleIsValid(tuple))
*/
pg_index = heap_open(IndexRelationId, RowExclusiveLock);
- indexTuple = SearchSysCacheCopy(INDEXRELID,
- ObjectIdGetDatum(indexRelationId),
- 0, 0, 0);
+ indexTuple = SearchSysCacheCopy1(INDEXRELID,
+ ObjectIdGetDatum(indexRelationId));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexRelationId);
indexForm = (Form_pg_index) GETSTRUCT(indexTuple);
*/
pg_index = heap_open(IndexRelationId, RowExclusiveLock);
- indexTuple = SearchSysCacheCopy(INDEXRELID,
- ObjectIdGetDatum(indexRelationId),
- 0, 0, 0);
+ indexTuple = SearchSysCacheCopy1(INDEXRELID,
+ ObjectIdGetDatum(indexRelationId));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexRelationId);
indexForm = (Form_pg_index) GETSTRUCT(indexTuple);
* so fetch the name of the selected opfamily for use in the
* error message.
*/
- opftuple = SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opfamily),
- 0, 0, 0);
+ opftuple = SearchSysCache1(OPFAMILYOID,
+ ObjectIdGetDatum(opfamily));
if (!HeapTupleIsValid(opftuple))
elog(ERROR, "cache lookup failed for opfamily %u",
opfamily);
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- tuple = SearchSysCache(CLAAMNAMENSP,
- ObjectIdGetDatum(accessMethodId),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ tuple = SearchSysCache3(CLAAMNAMENSP,
+ ObjectIdGetDatum(accessMethodId),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator class \"%s\" does not exist for access method \"%s\"",
opcname, accessMethodName)));
- tuple = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opClassId),
- 0, 0, 0);
+ tuple = SearchSysCache1(CLAOID, ObjectIdGetDatum(opClassId));
}
if (!HeapTupleIsValid(tuple))
Oid indexoid = lfirst_oid(indexoidscan);
HeapTuple indexTuple;
- indexTuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexoid),
- 0, 0, 0);
+ indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid));
if (!HeapTupleIsValid(indexTuple)) /* should not happen */
elog(ERROR, "cache lookup failed for index %u", indexoid);
result = ((Form_pg_index) GETSTRUCT(indexTuple))->indisprimary;
HeapTuple tuple;
indOid = RangeVarGetRelid(indexRelation, false);
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(indOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(indOid));
if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for relation %u", indOid);
HeapTuple tuple;
heapOid = RangeVarGetRelid(relation, false);
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(heapOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(heapOid));
if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for relation %u", heapOid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.65 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.66 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- return SearchSysCache(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amID),
- PointerGetDatum(opfname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ return SearchSysCache3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amID),
+ PointerGetDatum(opfname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (!OidIsValid(opfID))
return NULL;
- return SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opfID),
- 0, 0, 0);
+ return SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opfID));
}
}
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- return SearchSysCache(CLAAMNAMENSP,
- ObjectIdGetDatum(amID),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceId),
- 0);
+ return SearchSysCache3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amID),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
if (!OidIsValid(opcID))
return NULL;
- return SearchSysCache(CLAOID,
- ObjectIdGetDatum(opcID),
- 0, 0, 0);
+ return SearchSysCache1(CLAOID, ObjectIdGetDatum(opcID));
}
}
* Make sure there is no existing opfamily of this name (this is just to
* give a more friendly error message than "duplicate key").
*/
- if (SearchSysCacheExists(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amoid),
- CStringGetDatum(opfname),
- ObjectIdGetDatum(namespaceoid),
- 0))
+ if (SearchSysCacheExists3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amoid),
+ CStringGetDatum(opfname),
+ ObjectIdGetDatum(namespaceoid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("operator family \"%s\" for access method \"%s\" already exists",
get_namespace_name(namespaceoid));
/* Get necessary info about access method */
- tup = SearchSysCache(AMNAME,
- CStringGetDatum(stmt->amname),
- 0, 0, 0);
+ tup = SearchSysCache1(AMNAME, CStringGetDatum(stmt->amname));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
else
{
/* Lookup existing family of same name and namespace */
- tup = SearchSysCache(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amoid),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceoid),
- 0);
+ tup = SearchSysCache3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amoid),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceoid));
if (HeapTupleIsValid(tup))
{
opfamilyoid = HeapTupleGetOid(tup);
* Make sure there is no existing opclass of this name (this is just to
* give a more friendly error message than "duplicate key").
*/
- if (SearchSysCacheExists(CLAAMNAMENSP,
- ObjectIdGetDatum(amoid),
- CStringGetDatum(opcname),
- ObjectIdGetDatum(namespaceoid),
- 0))
+ if (SearchSysCacheExists3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amoid),
+ CStringGetDatum(opcname),
+ ObjectIdGetDatum(namespaceoid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("operator class \"%s\" for access method \"%s\" already exists",
get_namespace_name(namespaceoid));
/* Get necessary info about access method */
- tup = SearchSysCache(AMNAME,
- CStringGetDatum(stmt->amname),
- 0, 0, 0);
+ tup = SearchSysCache1(AMNAME, CStringGetDatum(stmt->amname));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
* Make sure there is no existing opfamily of this name (this is just to
* give a more friendly error message than "duplicate key").
*/
- if (SearchSysCacheExists(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amoid),
- CStringGetDatum(opfname),
- ObjectIdGetDatum(namespaceoid),
- 0))
+ if (SearchSysCacheExists3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amoid),
+ CStringGetDatum(opfname),
+ ObjectIdGetDatum(namespaceoid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("operator family \"%s\" for access method \"%s\" already exists",
Form_pg_am pg_am;
/* Get necessary info about access method */
- tup = SearchSysCache(AMNAME,
- CStringGetDatum(stmt->amname),
- 0, 0, 0);
+ tup = SearchSysCache1(AMNAME, CStringGetDatum(stmt->amname));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
Form_pg_operator opform;
/* Fetch the operator definition */
- optup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(member->object),
- 0, 0, 0);
+ optup = SearchSysCache1(OPEROID, ObjectIdGetDatum(member->object));
if (optup == NULL)
elog(ERROR, "cache lookup failed for operator %u", member->object);
opform = (Form_pg_operator) GETSTRUCT(optup);
Form_pg_proc procform;
/* Fetch the procedure definition */
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(member->object),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(member->object));
if (proctup == NULL)
elog(ERROR, "cache lookup failed for function %u", member->object);
procform = (Form_pg_proc) GETSTRUCT(proctup);
* existing pg_amop entry (just to give a nicer error message)
*/
if (isAdd &&
- SearchSysCacheExists(AMOPSTRATEGY,
- ObjectIdGetDatum(opfamilyoid),
- ObjectIdGetDatum(op->lefttype),
- ObjectIdGetDatum(op->righttype),
- Int16GetDatum(op->number)))
+ SearchSysCacheExists4(AMOPSTRATEGY,
+ ObjectIdGetDatum(opfamilyoid),
+ ObjectIdGetDatum(op->lefttype),
+ ObjectIdGetDatum(op->righttype),
+ Int16GetDatum(op->number)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("operator %d(%s,%s) already exists in operator family \"%s\"",
* existing pg_amproc entry (just to give a nicer error message)
*/
if (isAdd &&
- SearchSysCacheExists(AMPROCNUM,
- ObjectIdGetDatum(opfamilyoid),
- ObjectIdGetDatum(proc->lefttype),
- ObjectIdGetDatum(proc->righttype),
- Int16GetDatum(proc->number)))
+ SearchSysCacheExists4(AMPROCNUM,
+ ObjectIdGetDatum(opfamilyoid),
+ ObjectIdGetDatum(proc->lefttype),
+ ObjectIdGetDatum(proc->righttype),
+ Int16GetDatum(proc->number)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("function %d(%s,%s) already exists in operator family \"%s\"",
Oid amopid;
ObjectAddress object;
- amopid = GetSysCacheOid(AMOPSTRATEGY,
- ObjectIdGetDatum(opfamilyoid),
- ObjectIdGetDatum(op->lefttype),
- ObjectIdGetDatum(op->righttype),
- Int16GetDatum(op->number));
+ amopid = GetSysCacheOid4(AMOPSTRATEGY,
+ ObjectIdGetDatum(opfamilyoid),
+ ObjectIdGetDatum(op->lefttype),
+ ObjectIdGetDatum(op->righttype),
+ Int16GetDatum(op->number));
if (!OidIsValid(amopid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
Oid amprocid;
ObjectAddress object;
- amprocid = GetSysCacheOid(AMPROCNUM,
- ObjectIdGetDatum(opfamilyoid),
- ObjectIdGetDatum(op->lefttype),
- ObjectIdGetDatum(op->righttype),
- Int16GetDatum(op->number));
+ amprocid = GetSysCacheOid4(AMPROCNUM,
+ ObjectIdGetDatum(opfamilyoid),
+ ObjectIdGetDatum(op->lefttype),
+ ObjectIdGetDatum(op->righttype),
+ Int16GetDatum(op->number));
if (!OidIsValid(amprocid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
/*
* Get the access method's OID.
*/
- amID = GetSysCacheOid(AMNAME,
- CStringGetDatum(stmt->amname),
- 0, 0, 0);
+ amID = GetSysCacheOid1(AMNAME, CStringGetDatum(stmt->amname));
if (!OidIsValid(amID))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
/*
* Get the access method's OID.
*/
- amID = GetSysCacheOid(AMNAME,
- CStringGetDatum(stmt->amname),
- 0, 0, 0);
+ amID = GetSysCacheOid1(AMNAME, CStringGetDatum(stmt->amname));
if (!OidIsValid(amID))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
rel = heap_open(OperatorFamilyRelationId, RowExclusiveLock);
- tup = SearchSysCache(OPFAMILYOID,
- ObjectIdGetDatum(opfamilyOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opfamilyOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for opfamily %u", opfamilyOid);
rel = heap_open(OperatorClassRelationId, RowExclusiveLock);
- tup = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opclassOid),
- 0, 0, 0);
+ tup = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclassOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for opclass %u", opclassOid);
Relation rel;
AclResult aclresult;
- amOid = GetSysCacheOid(AMNAME,
- CStringGetDatum(access_method),
- 0, 0, 0);
+ amOid = GetSysCacheOid1(AMNAME, CStringGetDatum(access_method));
if (!OidIsValid(amOid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
{
namespaceOid = LookupExplicitNamespace(schemaname);
- tup = SearchSysCacheCopy(CLAAMNAMENSP,
- ObjectIdGetDatum(amOid),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceOid),
- 0);
+ tup = SearchSysCacheCopy3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amOid),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceOid));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator class \"%s\" does not exist for access method \"%s\"",
opcname, access_method)));
- tup = SearchSysCacheCopy(CLAOID,
- ObjectIdGetDatum(opcOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(CLAOID, ObjectIdGetDatum(opcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for opclass %u", opcOid);
}
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(CLAAMNAMENSP,
- ObjectIdGetDatum(amOid),
- CStringGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0))
+ if (SearchSysCacheExists3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amOid),
+ CStringGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
{
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
Relation rel;
AclResult aclresult;
- amOid = GetSysCacheOid(AMNAME,
- CStringGetDatum(access_method),
- 0, 0, 0);
+ amOid = GetSysCacheOid1(AMNAME, CStringGetDatum(access_method));
if (!OidIsValid(amOid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
{
namespaceOid = LookupExplicitNamespace(schemaname);
- tup = SearchSysCacheCopy(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amOid),
- PointerGetDatum(opfname),
- ObjectIdGetDatum(namespaceOid),
- 0);
+ tup = SearchSysCacheCopy3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amOid),
+ PointerGetDatum(opfname),
+ ObjectIdGetDatum(namespaceOid));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator family \"%s\" does not exist for access method \"%s\"",
opfname, access_method)));
- tup = SearchSysCacheCopy(OPFAMILYOID,
- ObjectIdGetDatum(opfOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(OPFAMILYOID, ObjectIdGetDatum(opfOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for opfamily %u", opfOid);
}
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amOid),
- CStringGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0))
+ if (SearchSysCacheExists3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amOid),
+ CStringGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
{
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
char *opcname;
char *schemaname;
- amOid = GetSysCacheOid(AMNAME,
- CStringGetDatum(access_method),
- 0, 0, 0);
+ amOid = GetSysCacheOid1(AMNAME, CStringGetDatum(access_method));
if (!OidIsValid(amOid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
namespaceOid = LookupExplicitNamespace(schemaname);
- tup = SearchSysCacheCopy(CLAAMNAMENSP,
- ObjectIdGetDatum(amOid),
- PointerGetDatum(opcname),
- ObjectIdGetDatum(namespaceOid),
- 0);
+ tup = SearchSysCacheCopy3(CLAAMNAMENSP,
+ ObjectIdGetDatum(amOid),
+ PointerGetDatum(opcname),
+ ObjectIdGetDatum(namespaceOid));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator class \"%s\" does not exist for access method \"%s\"",
opcname, access_method)));
- tup = SearchSysCacheCopy(CLAOID,
- ObjectIdGetDatum(opcOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(CLAOID, ObjectIdGetDatum(opcOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for opclass %u", opcOid);
}
char *opfname;
char *schemaname;
- amOid = GetSysCacheOid(AMNAME,
- CStringGetDatum(access_method),
- 0, 0, 0);
+ amOid = GetSysCacheOid1(AMNAME, CStringGetDatum(access_method));
if (!OidIsValid(amOid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
namespaceOid = LookupExplicitNamespace(schemaname);
- tup = SearchSysCacheCopy(OPFAMILYAMNAMENSP,
- ObjectIdGetDatum(amOid),
- PointerGetDatum(opfname),
- ObjectIdGetDatum(namespaceOid),
- 0);
+ tup = SearchSysCacheCopy3(OPFAMILYAMNAMENSP,
+ ObjectIdGetDatum(amOid),
+ PointerGetDatum(opfname),
+ ObjectIdGetDatum(namespaceOid));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("operator family \"%s\" does not exist for access method \"%s\"",
opfname, access_method)));
- tup = SearchSysCacheCopy(OPFAMILYOID,
- ObjectIdGetDatum(opfOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(OPFAMILYOID, ObjectIdGetDatum(opfOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for opfamily %u", opfOid);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.44 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.45 2010/02/14 18:42:14 rhaas Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
return;
}
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for operator %u", operOid);
relation = heap_open(OperatorRelationId, RowExclusiveLock);
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for operator %u", operOid);
Assert(RelationGetRelid(rel) == OperatorRelationId);
- tup = SearchSysCacheCopy(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(OPEROID, ObjectIdGetDatum(operOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for operator %u", operOid);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/proclang.c,v 1.88 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/proclang.c,v 1.89 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
*/
languageName = case_translate_language_name(stmt->plname);
- if (SearchSysCacheExists(LANGNAME,
- PointerGetDatum(languageName),
- 0, 0, 0))
+ if (SearchSysCacheExists1(LANGNAME, PointerGetDatum(languageName)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("language \"%s\" already exists", languageName)));
*/
languageName = case_translate_language_name(stmt->plname);
- langTup = SearchSysCache(LANGNAME,
- CStringGetDatum(languageName),
- 0, 0, 0);
+ langTup = SearchSysCache1(LANGNAME, CStringGetDatum(languageName));
if (!HeapTupleIsValid(langTup))
{
if (!stmt->missing_ok)
rel = heap_open(LanguageRelationId, RowExclusiveLock);
- langTup = SearchSysCache(LANGOID,
- ObjectIdGetDatum(langOid),
- 0, 0, 0);
+ langTup = SearchSysCache1(LANGOID, ObjectIdGetDatum(langOid));
if (!HeapTupleIsValid(langTup)) /* should not happen */
elog(ERROR, "cache lookup failed for language %u", langOid);
rel = heap_open(LanguageRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(LANGNAME,
- CStringGetDatum(oldname),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(LANGNAME, CStringGetDatum(oldname));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("language \"%s\" does not exist", oldname)));
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(LANGNAME,
- CStringGetDatum(newname),
- 0, 0, 0))
+ if (SearchSysCacheExists1(LANGNAME, CStringGetDatum(newname)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("language \"%s\" already exists", newname)));
rel = heap_open(LanguageRelationId, RowExclusiveLock);
- tup = SearchSysCache(LANGNAME,
- CStringGetDatum(name),
- 0, 0, 0);
+ tup = SearchSysCache1(LANGNAME, CStringGetDatum(name));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
rel = heap_open(LanguageRelationId, RowExclusiveLock);
- tup = SearchSysCache(LANGOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0);
+ tup = SearchSysCache1(LANGOID, ObjectIdGetDatum(oid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for language %u", oid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/schemacmds.c,v 1.55 2010/01/02 16:57:37 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/schemacmds.c,v 1.56 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
errmsg("schema name cannot be qualified")));
namespaceName = strVal(linitial(names));
- namespaceId = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(namespaceName),
- 0, 0, 0);
+ namespaceId = GetSysCacheOid1(NAMESPACENAME,
+ CStringGetDatum(namespaceName));
if (!OidIsValid(namespaceId))
{
relation = heap_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(schemaOid),
- 0, 0, 0);
+ tup = SearchSysCache1(NAMESPACEOID,
+ ObjectIdGetDatum(schemaOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for namespace %u", schemaOid);
rel = heap_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(NAMESPACENAME,
- CStringGetDatum(oldname),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(NAMESPACENAME, CStringGetDatum(oldname));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
/* make sure the new name doesn't exist */
if (HeapTupleIsValid(
- SearchSysCache(NAMESPACENAME,
- CStringGetDatum(newname),
- 0, 0, 0)))
+ SearchSysCache1(NAMESPACENAME,
+ CStringGetDatum(newname))))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_SCHEMA),
errmsg("schema \"%s\" already exists", newname)));
rel = heap_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(oid),
- 0, 0, 0);
+ tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for schema %u", oid);
rel = heap_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache(NAMESPACENAME,
- CStringGetDatum(name),
- 0, 0, 0);
+ tup = SearchSysCache1(NAMESPACENAME, CStringGetDatum(name));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.165 2010/02/09 21:43:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.166 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
errmsg("lastval is not yet defined in this session")));
/* Someone may have dropped the sequence since the last nextval() */
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(last_used_seq->relid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(last_used_seq->relid)))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("lastval is not yet defined in this session")));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.325 2010/02/07 20:48:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.326 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
*/
if (relkind == RELKIND_INDEX)
{
- tuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(relOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(relOid));
if (HeapTupleIsValid(tuple))
{
Form_pg_index index = (Form_pg_index) GETSTRUCT(tuple);
/* Get the lock before trying to fetch the syscache entry */
LockRelationOid(relOid, AccessExclusiveLock);
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relOid);
classform = (Form_pg_class) GETSTRUCT(tuple);
* need to update it, but we still need to issue an SI inval message.
*/
relationRelation = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relationId),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relationId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relationId);
classtuple = (Form_pg_class) GETSTRUCT(tuple);
/* new name should not already exist */
/* this test is deliberately not attisdropped-aware */
- if (SearchSysCacheExists(ATTNAME,
- ObjectIdGetDatum(myrelid),
- PointerGetDatum(newattname),
- 0, 0))
+ if (SearchSysCacheExists2(ATTNAME,
+ ObjectIdGetDatum(myrelid),
+ PointerGetDatum(newattname)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_COLUMN),
errmsg("column \"%s\" of relation \"%s\" already exists",
*/
relrelation = heap_open(RelationRelationId, RowExclusiveLock);
- reltup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(myrelid),
- 0, 0, 0);
+ reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(myrelid));
if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for relation %u", myrelid);
relform = (Form_pg_class) GETSTRUCT(reltup);
pgclass = heap_open(RelationRelationId, RowExclusiveLock);
- reltup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(myrelid),
- 0, 0, 0);
+ reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(myrelid));
if (!HeapTupleIsValid(reltup))
elog(ERROR, "cache lookup failed for relation %u", myrelid);
relkind = ((Form_pg_class) GETSTRUCT(reltup))->relkind;
* this test is deliberately not attisdropped-aware, since if one tries to
* add a column matching a dropped column name, it's gonna fail anyway.
*/
- if (SearchSysCacheExists(ATTNAME,
- ObjectIdGetDatum(myrelid),
- PointerGetDatum(colDef->colname),
- 0, 0))
+ if (SearchSysCacheExists2(ATTNAME,
+ ObjectIdGetDatum(myrelid),
+ PointerGetDatum(colDef->colname)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_COLUMN),
errmsg("column \"%s\" of relation \"%s\" already exists",
Form_pg_index indexStruct;
int i;
- indexTuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexoid),
- 0, 0, 0);
+ indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexoid);
indexStruct = (Form_pg_index) GETSTRUCT(indexTuple);
class_rel = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(RelationGetRelid(rel)),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u",
RelationGetRelid(rel));
int16 eqstrategy;
/* We need several fields out of the pg_opclass entry */
- cla_ht = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opclasses[i]),
- 0, 0, 0);
+ cla_ht = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclasses[i]));
if (!HeapTupleIsValid(cla_ht))
elog(ERROR, "cache lookup failed for opclass %u", opclasses[i]);
cla_tup = (Form_pg_opclass) GETSTRUCT(cla_ht);
{
Oid indexoid = lfirst_oid(indexoidscan);
- indexTuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexoid),
- 0, 0, 0);
+ indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexoid);
indexStruct = (Form_pg_index) GETSTRUCT(indexTuple);
j;
indexoid = lfirst_oid(indexoidscan);
- indexTuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexoid),
- 0, 0, 0);
+ indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid));
if (!HeapTupleIsValid(indexTuple))
elog(ERROR, "cache lookup failed for index %u", indexoid);
indexStruct = (Form_pg_index) GETSTRUCT(indexTuple);
/* Get its pg_class tuple, too */
class_rel = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relationOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relationOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relationOid);
tuple_class = (Form_pg_class) GETSTRUCT(tuple);
/* Get the old reloptions */
relid = RelationGetRelid(rel);
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relid);
toastrel = heap_open(toastid, AccessExclusiveLock);
/* Get the old reloptions */
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(toastid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(toastid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", toastid);
/* Get a modifiable copy of the relation's pg_class row */
pg_class = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(tableOid),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(tableOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", tableOid);
rd_rel = (Form_pg_class) GETSTRUCT(tuple);
HeapTuple classTup;
Form_pg_class classForm;
- classTup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relOid),
- 0, 0, 0);
+ classTup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relOid));
if (!HeapTupleIsValid(classTup))
elog(ERROR, "cache lookup failed for relation %u", relOid);
classForm = (Form_pg_class) GETSTRUCT(classTup);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.260 2010/01/24 21:49:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.261 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* entries.
*/
pgrel = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(RelationGetRelid(rel)),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u",
RelationGetRelid(rel));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tsearchcmds.c,v 1.19 2010/01/02 16:57:39 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tsearchcmds.c,v 1.20 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
relation = heap_open(TSParserRelationId, RowExclusiveLock);
- tup = SearchSysCache(TSPARSEROID,
- ObjectIdGetDatum(prsId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSPARSEROID, ObjectIdGetDatum(prsId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search parser %u", prsId);
prsId = TSParserGetPrsid(oldname, false);
- tup = SearchSysCacheCopy(TSPARSEROID,
- ObjectIdGetDatum(prsId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TSPARSEROID, ObjectIdGetDatum(prsId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search parser %u", prsId);
namespaceOid = ((Form_pg_ts_parser) GETSTRUCT(tup))->prsnamespace;
- if (SearchSysCacheExists(TSPARSERNAMENSP,
- PointerGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0, 0))
+ if (SearchSysCacheExists2(TSPARSERNAMENSP,
+ PointerGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("text search parser \"%s\" already exists",
if (!IsUnderPostmaster)
return;
- tup = SearchSysCache(TSTEMPLATEOID,
- ObjectIdGetDatum(tmplId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSTEMPLATEOID, ObjectIdGetDatum(tmplId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search template %u",
tmplId);
dictId = TSDictionaryGetDictid(oldname, false);
- tup = SearchSysCacheCopy(TSDICTOID,
- ObjectIdGetDatum(dictId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TSDICTOID, ObjectIdGetDatum(dictId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search dictionary %u",
namespaceOid = ((Form_pg_ts_dict) GETSTRUCT(tup))->dictnamespace;
- if (SearchSysCacheExists(TSDICTNAMENSP,
- PointerGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0, 0))
+ if (SearchSysCacheExists2(TSDICTNAMENSP,
+ PointerGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("text search dictionary \"%s\" already exists",
continue;
}
- tup = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dictOid),
- 0, 0, 0);
+ tup = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dictOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search dictionary %u",
dictOid);
relation = heap_open(TSDictionaryRelationId, RowExclusiveLock);
- tup = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dictId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dictId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search dictionary %u",
rel = heap_open(TSDictionaryRelationId, RowExclusiveLock);
- tup = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dictId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dictId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search dictionary %u",
dictId = TSDictionaryGetDictid(name, false);
- tup = SearchSysCacheCopy(TSDICTOID,
- ObjectIdGetDatum(dictId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TSDICTOID, ObjectIdGetDatum(dictId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search dictionary %u",
tmplId = TSTemplateGetTmplid(oldname, false);
- tup = SearchSysCacheCopy(TSTEMPLATEOID,
- ObjectIdGetDatum(tmplId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TSTEMPLATEOID, ObjectIdGetDatum(tmplId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search template %u",
namespaceOid = ((Form_pg_ts_template) GETSTRUCT(tup))->tmplnamespace;
- if (SearchSysCacheExists(TSTEMPLATENAMENSP,
- PointerGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0, 0))
+ if (SearchSysCacheExists2(TSTEMPLATENAMENSP,
+ PointerGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("text search template \"%s\" already exists",
relation = heap_open(TSTemplateRelationId, RowExclusiveLock);
- tup = SearchSysCache(TSTEMPLATEOID,
- ObjectIdGetDatum(tmplId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSTEMPLATEOID, ObjectIdGetDatum(tmplId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search template %u",
if (!OidIsValid(cfgId))
return NULL;
- tup = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfgId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search configuration %u",
{
Form_pg_ts_config cfg;
- tup = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(sourceOid),
- 0, 0, 0);
+ tup = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(sourceOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search configuration %u",
sourceOid);
cfgId = TSConfigGetCfgid(oldname, false);
- tup = SearchSysCacheCopy(TSCONFIGOID,
- ObjectIdGetDatum(cfgId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TSCONFIGOID, ObjectIdGetDatum(cfgId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search configuration %u",
namespaceOid = ((Form_pg_ts_config) GETSTRUCT(tup))->cfgnamespace;
- if (SearchSysCacheExists(TSCONFIGNAMENSP,
- PointerGetDatum(newname),
- ObjectIdGetDatum(namespaceOid),
- 0, 0))
+ if (SearchSysCacheExists2(TSCONFIGNAMENSP,
+ PointerGetDatum(newname),
+ ObjectIdGetDatum(namespaceOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("text search configuration \"%s\" already exists",
/* Remove the pg_ts_config entry */
relCfg = heap_open(TSConfigRelationId, RowExclusiveLock);
- tup = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfgId),
- 0, 0, 0);
+ tup = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for text search dictionary %u",
cfgId = TSConfigGetCfgid(name, false);
- tup = SearchSysCacheCopy(TSCONFIGOID,
- ObjectIdGetDatum(cfgId),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TSCONFIGOID, ObjectIdGetDatum(cfgId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for text search configuration %u",
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.146 2010/01/20 05:47:09 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.147 2010/02/14 18:42:14 rhaas Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
* Look to see if type already exists (presumably as a shell; if not,
* TypeCreate will complain).
*/
- typoid = GetSysCacheOid(TYPENAMENSP,
- CStringGetDatum(typeName),
- ObjectIdGetDatum(typeNamespace),
- 0, 0);
+ typoid = GetSysCacheOid2(TYPENAMENSP,
+ CStringGetDatum(typeName),
+ ObjectIdGetDatum(typeNamespace));
/*
* If it's not a shell, see if it's an autogenerated array type, and if so
relation = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
* Check for collision with an existing type name. If there is one and
* it's an autogenerated array, we can rename it out of the way.
*/
- old_type_oid = GetSysCacheOid(TYPENAMENSP,
- CStringGetDatum(domainName),
- ObjectIdGetDatum(domainNamespace),
- 0, 0);
+ old_type_oid = GetSysCacheOid2(TYPENAMENSP,
+ CStringGetDatum(domainName),
+ ObjectIdGetDatum(domainNamespace));
if (OidIsValid(old_type_oid))
{
if (!moveArrayTypeName(old_type_oid, domainName, domainNamespace))
* Check for collision with an existing type name. If there is one and
* it's an autogenerated array, we can rename it out of the way.
*/
- old_type_oid = GetSysCacheOid(TYPENAMENSP,
- CStringGetDatum(enumName),
- ObjectIdGetDatum(enumNamespace),
- 0, 0);
+ old_type_oid = GetSysCacheOid2(TYPENAMENSP,
+ CStringGetDatum(enumName),
+ ObjectIdGetDatum(enumNamespace));
if (OidIsValid(old_type_oid))
{
if (!moveArrayTypeName(old_type_oid, enumName, enumNamespace))
* about a "type" instead of below about a "relation".
*/
typeNamespace = RangeVarGetCreationNamespace(createStmt->relation);
- old_type_oid = GetSysCacheOid(TYPENAMENSP,
- CStringGetDatum(createStmt->relation->relname),
- ObjectIdGetDatum(typeNamespace),
- 0, 0);
+ old_type_oid =
+ GetSysCacheOid2(TYPENAMENSP,
+ CStringGetDatum(createStmt->relation->relname),
+ ObjectIdGetDatum(typeNamespace));
if (OidIsValid(old_type_oid))
{
if (!moveArrayTypeName(old_type_oid, createStmt->relation->relname, typeNamespace))
/* Look up the domain in the type table */
rel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(domainoid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(domainoid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", domainoid);
typTup = (Form_pg_type) GETSTRUCT(tup);
/* Look up the domain in the type table */
typrel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(domainoid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(domainoid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", domainoid);
typTup = (Form_pg_type) GETSTRUCT(tup);
/* Look up the domain in the type table */
rel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(domainoid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(domainoid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", domainoid);
/* Look up the domain in the type table */
typrel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(domainoid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(domainoid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", domainoid);
typTup = (Form_pg_type) GETSTRUCT(tup);
ScanKeyData key[1];
SysScanDesc scan;
- tup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
typTup = (Form_pg_type) GETSTRUCT(tup);
/* Look up the type in the type table */
rel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
typTup = (Form_pg_type) GETSTRUCT(tup);
rel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
typTup = (Form_pg_type) GETSTRUCT(tup);
rel = heap_open(TypeRelationId, RowExclusiveLock);
- tup = SearchSysCacheCopy(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ tup = SearchSysCacheCopy1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
typform = (Form_pg_type) GETSTRUCT(tup);
errmsg("cannot move objects into or out of TOAST schema")));
/* check for duplicate name (more friendly than unique-index failure) */
- if (SearchSysCacheExists(TYPENAMENSP,
- CStringGetDatum(NameStr(typform->typname)),
- ObjectIdGetDatum(nspOid),
- 0, 0))
+ if (SearchSysCacheExists2(TYPENAMENSP,
+ CStringGetDatum(NameStr(typform->typname)),
+ ObjectIdGetDatum(nspOid)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("type \"%s\" already exists in schema \"%s\"",
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.191 2010/01/02 16:57:39 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.192 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
if (superuser())
return true;
- utup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(GetUserId()),
- 0, 0, 0);
+ utup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(GetUserId()));
if (HeapTupleIsValid(utup))
{
result = ((Form_pg_authid) GETSTRUCT(utup))->rolcreaterole;
pg_authid_rel = heap_open(AuthIdRelationId, RowExclusiveLock);
pg_authid_dsc = RelationGetDescr(pg_authid_rel);
- tuple = SearchSysCache(AUTHNAME,
- PointerGetDatum(stmt->role),
- 0, 0, 0);
+ tuple = SearchSysCache1(AUTHNAME, PointerGetDatum(stmt->role));
if (HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
pg_authid_rel = heap_open(AuthIdRelationId, RowExclusiveLock);
pg_authid_dsc = RelationGetDescr(pg_authid_rel);
- tuple = SearchSysCache(AUTHNAME,
- PointerGetDatum(stmt->role),
- 0, 0, 0);
+ tuple = SearchSysCache1(AUTHNAME, PointerGetDatum(stmt->role));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
HeapTuple roletuple;
Oid databaseid = InvalidOid;
- roletuple = SearchSysCache(AUTHNAME,
- PointerGetDatum(stmt->role),
- 0, 0, 0);
+ roletuple = SearchSysCache1(AUTHNAME, PointerGetDatum(stmt->role));
if (!HeapTupleIsValid(roletuple))
ereport(ERROR,
SysScanDesc sscan;
Oid roleid;
- tuple = SearchSysCache(AUTHNAME,
- PointerGetDatum(role),
- 0, 0, 0);
+ tuple = SearchSysCache1(AUTHNAME, PointerGetDatum(role));
if (!HeapTupleIsValid(tuple))
{
if (!stmt->missing_ok)
rel = heap_open(AuthIdRelationId, RowExclusiveLock);
dsc = RelationGetDescr(rel);
- oldtuple = SearchSysCache(AUTHNAME,
- CStringGetDatum(oldname),
- 0, 0, 0);
+ oldtuple = SearchSysCache1(AUTHNAME, CStringGetDatum(oldname));
if (!HeapTupleIsValid(oldtuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("current user cannot be renamed")));
/* make sure the new name doesn't exist */
- if (SearchSysCacheExists(AUTHNAME,
- CStringGetDatum(newname),
- 0, 0, 0))
+ if (SearchSysCacheExists1(AUTHNAME, CStringGetDatum(newname)))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("role \"%s\" already exists", newname)));
* Check if entry for this role/member already exists; if so, give
* warning unless we are adding admin option.
*/
- authmem_tuple = SearchSysCache(AUTHMEMROLEMEM,
- ObjectIdGetDatum(roleid),
- ObjectIdGetDatum(memberid),
- 0, 0);
+ authmem_tuple = SearchSysCache2(AUTHMEMROLEMEM,
+ ObjectIdGetDatum(roleid),
+ ObjectIdGetDatum(memberid));
if (HeapTupleIsValid(authmem_tuple) &&
(!admin_opt ||
((Form_pg_auth_members) GETSTRUCT(authmem_tuple))->admin_option))
/*
* Find entry for this role/member
*/
- authmem_tuple = SearchSysCache(AUTHMEMROLEMEM,
- ObjectIdGetDatum(roleid),
- ObjectIdGetDatum(memberid),
- 0, 0);
+ authmem_tuple = SearchSysCache2(AUTHMEMROLEMEM,
+ ObjectIdGetDatum(roleid),
+ ObjectIdGetDatum(memberid));
if (!HeapTupleIsValid(authmem_tuple))
{
ereport(WARNING,
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.407 2010/02/09 21:43:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.408 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
rd = heap_open(RelationRelationId, RowExclusiveLock);
/* Fetch a copy of the tuple to scribble on */
- ctup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ ctup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(ctup))
elog(ERROR, "pg_class entry for relid %u vanished during vacuuming",
relid);
relation = heap_open(DatabaseRelationId, RowExclusiveLock);
/* Fetch a copy of the tuple to scribble on */
- tuple = SearchSysCacheCopy(DATABASEOID,
- ObjectIdGetDatum(MyDatabaseId),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(DATABASEOID, ObjectIdGetDatum(MyDatabaseId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "could not find tuple for database %u", MyDatabaseId);
dbform = (Form_pg_database) GETSTRUCT(tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.132 2010/01/02 16:57:40 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.133 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
return NULL;
}
- roleTup = SearchSysCache(AUTHNAME,
- PointerGetDatum(value),
- 0, 0, 0);
+ roleTup = SearchSysCache1(AUTHNAME, PointerGetDatum(value));
if (!HeapTupleIsValid(roleTup))
{
ereport(GUC_complaint_elevel(source),
return NULL;
}
- roleTup = SearchSysCache(AUTHNAME,
- PointerGetDatum(value),
- 0, 0, 0);
+ roleTup = SearchSysCache1(AUTHNAME, PointerGetDatum(value));
if (!HeapTupleIsValid(roleTup))
{
ereport(GUC_complaint_elevel(source),
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/executor/execAmi.c,v 1.107 2010/01/02 16:57:40 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execAmi.c,v 1.108 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
Form_pg_am amrec;
/* Fetch the pg_class tuple of the index relation */
- ht_idxrel = SearchSysCache(RELOID,
- ObjectIdGetDatum(indexid),
- 0, 0, 0);
+ ht_idxrel = SearchSysCache1(RELOID, ObjectIdGetDatum(indexid));
if (!HeapTupleIsValid(ht_idxrel))
elog(ERROR, "cache lookup failed for relation %u", indexid);
idxrelrec = (Form_pg_class) GETSTRUCT(ht_idxrel);
/* Fetch the pg_am tuple of the index' access method */
- ht_am = SearchSysCache(AMOID,
- ObjectIdGetDatum(idxrelrec->relam),
- 0, 0, 0);
+ ht_am = SearchSysCache1(AMOID, ObjectIdGetDatum(idxrelrec->relam));
if (!HeapTupleIsValid(ht_am))
elog(ERROR, "cache lookup failed for access method %u",
idxrelrec->relam);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.140 2010/01/02 16:57:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.141 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* get the procedure tuple corresponding to the given function Oid
*/
- procedureTuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(foid),
- 0, 0, 0);
+ procedureTuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(foid));
if (!HeapTupleIsValid(procedureTuple))
elog(ERROR, "cache lookup failed for function %u", foid);
procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple);
int syntaxerrposition;
/* Need access to function's pg_proc tuple */
- func_tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(flinfo->fn_oid),
- 0, 0, 0);
+ func_tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(flinfo->fn_oid));
if (!HeapTupleIsValid(func_tuple))
return; /* shouldn't happen */
functup = (Form_pg_proc) GETSTRUCT(func_tuple);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.173 2010/02/12 17:33:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.174 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
}
peraggstate->numArguments = numArguments;
- aggTuple = SearchSysCache(AGGFNOID,
- ObjectIdGetDatum(aggref->aggfnoid),
- 0, 0, 0);
+ aggTuple = SearchSysCache1(AGGFNOID,
+ ObjectIdGetDatum(aggref->aggfnoid));
if (!HeapTupleIsValid(aggTuple))
elog(ERROR, "cache lookup failed for aggregate %u",
aggref->aggfnoid);
HeapTuple procTuple;
Oid aggOwner;
- procTuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(aggref->aggfnoid),
- 0, 0, 0);
+ procTuple = SearchSysCache1(PROCOID,
+ ObjectIdGetDatum(aggref->aggfnoid));
if (!HeapTupleIsValid(procTuple))
elog(ERROR, "cache lookup failed for function %u",
aggref->aggfnoid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.127 2010/02/01 15:43:36 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.128 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Try to find the MCV statistics for the outer relation's join key.
*/
- statsTuple = SearchSysCache(STATRELATTINH,
- ObjectIdGetDatum(node->skewTable),
- Int16GetDatum(node->skewColumn),
- BoolGetDatum(node->skewInherit),
- 0);
+ statsTuple = SearchSysCache3(STATRELATTINH,
+ ObjectIdGetDatum(node->skewTable),
+ Int16GetDatum(node->skewColumn),
+ BoolGetDatum(node->skewInherit));
if (!HeapTupleIsValid(statsTuple))
return;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.10 2010/02/12 17:33:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.11 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
inputTypes[i++] = exprType((Node *) lfirst(lc));
}
- aggTuple = SearchSysCache(AGGFNOID,
- ObjectIdGetDatum(wfunc->winfnoid),
- 0, 0, 0);
+ aggTuple = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(wfunc->winfnoid));
if (!HeapTupleIsValid(aggTuple))
elog(ERROR, "cache lookup failed for aggregate %u",
wfunc->winfnoid);
HeapTuple procTuple;
Oid aggOwner;
- procTuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(wfunc->winfnoid),
- 0, 0, 0);
+ procTuple = SearchSysCache1(PROCOID,
+ ObjectIdGetDatum(wfunc->winfnoid));
if (!HeapTupleIsValid(procTuple))
elog(ERROR, "cache lookup failed for function %u",
wfunc->winfnoid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.213 2010/01/02 16:57:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.214 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
else
typoid = (SystemAttributeDefinition(fnumber, true))->atttypid;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typoid),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typoid));
if (!HeapTupleIsValid(typeTuple))
{
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/foreign/foreign.c,v 1.7 2010/01/02 16:57:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/foreign/foreign.c,v 1.8 2010/02/14 18:42:14 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
HeapTuple tp;
bool isnull;
- tp = SearchSysCache(FOREIGNDATAWRAPPEROID,
- ObjectIdGetDatum(fdwid),
- 0, 0, 0);
+ tp = SearchSysCache1(FOREIGNDATAWRAPPEROID, ObjectIdGetDatum(fdwid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for foreign-data wrapper %u", fdwid);
{
Oid fdwId;
- fdwId = GetSysCacheOid(FOREIGNDATAWRAPPERNAME,
- CStringGetDatum(fdwname),
- 0, 0, 0);
+ fdwId = GetSysCacheOid1(FOREIGNDATAWRAPPERNAME, CStringGetDatum(fdwname));
if (!OidIsValid(fdwId) && !missing_ok)
ereport(ERROR,
Datum datum;
bool isnull;
- tp = SearchSysCache(FOREIGNSERVEROID,
- ObjectIdGetDatum(serverid),
- 0, 0, 0);
+ tp = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(serverid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for foreign server %u", serverid);
{
Oid serverid;
- serverid = GetSysCacheOid(FOREIGNSERVERNAME,
- CStringGetDatum(srvname),
- 0, 0, 0);
+ serverid = GetSysCacheOid1(FOREIGNSERVERNAME, CStringGetDatum(srvname));
if (!OidIsValid(serverid) && !missing_ok)
ereport(ERROR,
bool isnull;
UserMapping *um;
- tp = SearchSysCache(USERMAPPINGUSERSERVER,
- ObjectIdGetDatum(userid),
- ObjectIdGetDatum(serverid),
- 0, 0);
+ tp = SearchSysCache2(USERMAPPINGUSERSERVER,
+ ObjectIdGetDatum(userid),
+ ObjectIdGetDatum(serverid));
if (!HeapTupleIsValid(tp))
{
/* Not found for the specific user -- try PUBLIC */
- tp = SearchSysCache(USERMAPPINGUSERSERVER,
- ObjectIdGetDatum(InvalidOid),
- ObjectIdGetDatum(serverid),
- 0, 0);
+ tp = SearchSysCache2(USERMAPPINGUSERSERVER,
+ ObjectIdGetDatum(InvalidOid),
+ ObjectIdGetDatum(serverid));
}
if (!HeapTupleIsValid(tp))
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.79 2010/01/02 16:57:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.80 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
ImmediateInterruptOK = false;
/* Get role info from pg_authid */
- roleTup = SearchSysCache(AUTHNAME,
- PointerGetDatum(role),
- 0, 0, 0);
+ roleTup = SearchSysCache1(AUTHNAME, PointerGetDatum(role));
if (!HeapTupleIsValid(roleTup))
return STATUS_ERROR; /* no such user */
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.50 2010/01/02 16:57:47 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.51 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
Oid aggsortop;
/* fetch aggregate entry from pg_aggregate */
- aggTuple = SearchSysCache(AGGFNOID,
- ObjectIdGetDatum(aggfnoid),
- 0, 0, 0);
+ aggTuple = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(aggfnoid));
if (!HeapTupleIsValid(aggTuple))
return InvalidOid;
aggform = (Form_pg_aggregate) GETSTRUCT(aggTuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.158 2010/02/12 17:33:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.159 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
HeapTuple func_tuple;
PlanInvalItem *inval_item;
- func_tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ func_tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(func_tuple))
elog(ERROR, "cache lookup failed for function %u", funcid);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.159 2010/02/12 17:33:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.160 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
if (list_length(expr->args) != 2)
return false;
/* else must look up the operator properties */
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(opid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for operator %u", opid);
optup = (Form_pg_operator) GETSTRUCT(tup);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.284 2010/01/19 16:33:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.285 2010/02/14 18:42:15 rhaas Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
}
/* fetch aggregate transition datatype from pg_aggregate */
- aggTuple = SearchSysCache(AGGFNOID,
- ObjectIdGetDatum(aggref->aggfnoid),
- 0, 0, 0);
+ aggTuple = SearchSysCache1(AGGFNOID,
+ ObjectIdGetDatum(aggref->aggfnoid));
if (!HeapTupleIsValid(aggTuple))
elog(ERROR, "cache lookup failed for aggregate %u",
aggref->aggfnoid);
* to the function's pg_proc tuple, so fetch it just once to use in both
* attempts.
*/
- func_tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ func_tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(func_tuple))
elog(ERROR, "cache lookup failed for function %u", funcid);
/*
* OK, let's take a look at the function's pg_proc entry.
*/
- func_tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(func_oid),
- 0, 0, 0);
+ func_tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(func_oid));
if (!HeapTupleIsValid(func_tuple))
elog(ERROR, "cache lookup failed for function %u", func_oid);
funcform = (Form_pg_proc) GETSTRUCT(func_tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.30 2010/01/02 16:57:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.31 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* corresponding test operator. This should work for any logically
* consistent opfamilies.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(pred_op),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(pred_op));
/*
* If we couldn't find any opfamily containing the pred_op, perhaps it is
{
pred_op_negated = true;
ReleaseSysCacheList(catlist);
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(pred_op_negator),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID,
+ ObjectIdGetDatum(pred_op_negator));
}
}
* From the same opfamily, find a strategy number for the clause_op,
* if possible
*/
- clause_tuple = SearchSysCache(AMOPOPID,
- ObjectIdGetDatum(clause_op),
- ObjectIdGetDatum(opfamily_id),
- 0, 0);
+ clause_tuple = SearchSysCache2(AMOPOPID,
+ ObjectIdGetDatum(clause_op),
+ ObjectIdGetDatum(opfamily_id));
if (HeapTupleIsValid(clause_tuple))
{
Form_pg_amop clause_form = (Form_pg_amop) GETSTRUCT(clause_tuple);
}
else if (OidIsValid(clause_op_negator))
{
- clause_tuple = SearchSysCache(AMOPOPID,
- ObjectIdGetDatum(clause_op_negator),
- ObjectIdGetDatum(opfamily_id),
- 0, 0);
+ clause_tuple = SearchSysCache2(AMOPOPID,
+ ObjectIdGetDatum(clause_op_negator),
+ ObjectIdGetDatum(opfamily_id));
if (HeapTupleIsValid(clause_tuple))
{
Form_pg_amop clause_form = (Form_pg_amop) GETSTRUCT(clause_tuple);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
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);
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))
{
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))
{
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
}
- 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);
}
/* 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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
}
}
if (OidIsValid(operOid))
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
{
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;
}
}
if (OidIsValid(operOid))
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
{
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;
}
}
if (OidIsValid(operOid))
- tup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operOid),
- 0, 0, 0);
+ tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
if (HeapTupleIsValid(tup))
{
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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 */
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);
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);
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
- typoid = GetSysCacheOid(TYPENAMENSP,
- PointerGetDatum(typname),
- ObjectIdGetDatum(namespaceId),
- 0, 0);
+ typoid = GetSysCacheOid2(TYPENAMENSP,
+ PointerGetDatum(typname),
+ ObjectIdGetDatum(namespaceId));
}
else
{
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);
{
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;
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);
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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);
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);
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);
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);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.107 2010/01/02 16:57:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.108 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* zero in template and nonconnectable databases, else the system-wide
* default.
*/
- tuple = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(MyDatabaseId),
- 0, 0, 0);
+ tuple = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(MyDatabaseId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for database %u", MyDatabaseId);
dbForm = (Form_pg_database) GETSTRUCT(tuple);
dbentry = pgstat_fetch_stat_dbentry(MyDatabaseId);
/* fetch the relation's relcache entry */
- classTup = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ classTup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(classTup))
return NULL;
classForm = (Form_pg_class) GETSTRUCT(classTup);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.140 2010/01/02 16:57:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.141 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Check to see if we are replacing an existing tuple
*/
- oldtup = SearchSysCache(RULERELNAME,
- ObjectIdGetDatum(eventrel_oid),
- PointerGetDatum(rulname),
- 0, 0);
+ oldtup = SearchSysCache2(RULERELNAME,
+ ObjectIdGetDatum(eventrel_oid),
+ PointerGetDatum(rulname));
if (HeapTupleIsValid(oldtup))
{
* Find the rule tuple to change.
*/
pg_rewrite_desc = heap_open(RewriteRelationId, RowExclusiveLock);
- ruletup = SearchSysCacheCopy(RULERELNAME,
- ObjectIdGetDatum(owningRel),
- PointerGetDatum(rulename),
- 0, 0);
+ ruletup = SearchSysCacheCopy2(RULERELNAME,
+ ObjectIdGetDatum(owningRel),
+ PointerGetDatum(rulename));
if (!HeapTupleIsValid(ruletup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
pg_rewrite_desc = heap_open(RewriteRelationId, RowExclusiveLock);
- ruletup = SearchSysCacheCopy(RULERELNAME,
- ObjectIdGetDatum(owningRel),
- PointerGetDatum(oldName),
- 0, 0);
+ ruletup = SearchSysCacheCopy2(RULERELNAME,
+ ObjectIdGetDatum(owningRel),
+ PointerGetDatum(oldName));
if (!HeapTupleIsValid(ruletup))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteRemove.c,v 1.79 2010/01/02 16:57:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteRemove.c,v 1.80 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Find the tuple for the target rule.
*/
- tuple = SearchSysCache(RULERELNAME,
- ObjectIdGetDatum(owningRel),
- PointerGetDatum(ruleName),
- 0, 0);
+ tuple = SearchSysCache2(RULERELNAME,
+ ObjectIdGetDatum(owningRel),
+ PointerGetDatum(ruleName));
/*
* complain if no rule with such name exists
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteSupport.c,v 1.68 2010/01/02 16:57:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteSupport.c,v 1.69 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
bool
IsDefinedRewriteRule(Oid owningRel, const char *ruleName)
{
- return SearchSysCacheExists(RULERELNAME,
- ObjectIdGetDatum(owningRel),
- PointerGetDatum(ruleName),
- 0, 0);
+ return SearchSysCacheExists2(RULERELNAME,
+ ObjectIdGetDatum(owningRel),
+ PointerGetDatum(ruleName));
}
* Find the tuple to update in pg_class, using syscache for the lookup.
*/
relationRelation = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(relationId),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(relationId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relationId);
classForm = (Form_pg_class) GETSTRUCT(tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.102 2010/01/02 16:57:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.103 2010/02/14 18:42:15 rhaas Exp $
*
* NOTES
* This cruft is the server side of PQfn.
fmgr_info(func_id, &fip->flinfo);
- func_htp = SearchSysCache(PROCOID,
- ObjectIdGetDatum(func_id),
- 0, 0, 0);
+ func_htp = SearchSysCache1(PROCOID, ObjectIdGetDatum(func_id));
if (!HeapTupleIsValid(func_htp))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.331 2010/01/29 06:03:15 itagaki Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.332 2010/02/14 18:42:15 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
HeapTuple tuple;
relOid = RangeVarGetRelid(rel, false);
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relOid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relOid));
if (!HeapTupleIsValid(tuple)) /* should not happen */
elog(ERROR, "cache lookup failed for relation %u", relOid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.155 2010/01/12 02:39:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.156 2010/02/14 18:42:16 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
if (aip->ai_grantee != ACL_ID_PUBLIC)
{
- htup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(aip->ai_grantee),
- 0, 0, 0);
+ htup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(aip->ai_grantee));
if (HeapTupleIsValid(htup))
{
putid(p, NameStr(((Form_pg_authid) GETSTRUCT(htup))->rolname));
*p++ = '/';
*p = '\0';
- htup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(aip->ai_grantor),
- 0, 0, 0);
+ htup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(aip->ai_grantor));
if (HeapTupleIsValid(htup))
{
putid(p, NameStr(((Form_pg_authid) GETSTRUCT(htup))->rolname));
roleid = get_roleid_checked(NameStr(*username));
mode = convert_table_priv_string(priv_type_text);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
PG_RETURN_NULL();
aclresult = pg_class_aclcheck(tableoid, roleid, mode);
roleid = GetUserId();
mode = convert_table_priv_string(priv_type_text);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
PG_RETURN_NULL();
aclresult = pg_class_aclcheck(tableoid, roleid, mode);
mode = convert_table_priv_string(priv_type_text);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
PG_RETURN_NULL();
aclresult = pg_class_aclcheck(tableoid, roleid, mode);
roleid = get_roleid_checked(NameStr(*username));
mode = convert_column_priv_string(priv_type_text);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
PG_RETURN_NULL();
/* First check at table level, then examine each column if needed */
roleid = GetUserId();
mode = convert_column_priv_string(priv_type_text);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
PG_RETURN_NULL();
/* First check at table level, then examine each column if needed */
mode = convert_column_priv_string(priv_type_text);
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
PG_RETURN_NULL();
/* First check at table level, then examine each column if needed */
* here and there. So if we see the row in the syscache, so will
* pg_class_aclcheck.
*/
- if (!SearchSysCacheExists(RELOID,
- ObjectIdGetDatum(tableoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(tableoid)))
return -1;
aclresult = pg_class_aclcheck(tableoid, roleid, mode);
* check for dropped attribute first, and we rely on the syscache not to
* notice a concurrent drop before pg_attribute_aclcheck fetches the row.
*/
- attTuple = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(tableoid),
- Int16GetDatum(attnum),
- 0, 0);
+ attTuple = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(tableoid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(attTuple))
return -1;
attributeForm = (Form_pg_attribute) GETSTRUCT(attTuple);
roleid = get_roleid_checked(NameStr(*username));
mode = convert_database_priv_string(priv_type_text);
- if (!SearchSysCacheExists(DATABASEOID,
- ObjectIdGetDatum(databaseoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(DATABASEOID, ObjectIdGetDatum(databaseoid)))
PG_RETURN_NULL();
aclresult = pg_database_aclcheck(databaseoid, roleid, mode);
roleid = GetUserId();
mode = convert_database_priv_string(priv_type_text);
- if (!SearchSysCacheExists(DATABASEOID,
- ObjectIdGetDatum(databaseoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(DATABASEOID, ObjectIdGetDatum(databaseoid)))
PG_RETURN_NULL();
aclresult = pg_database_aclcheck(databaseoid, roleid, mode);
mode = convert_database_priv_string(priv_type_text);
- if (!SearchSysCacheExists(DATABASEOID,
- ObjectIdGetDatum(databaseoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(DATABASEOID, ObjectIdGetDatum(databaseoid)))
PG_RETURN_NULL();
aclresult = pg_database_aclcheck(databaseoid, roleid, mode);
roleid = get_roleid_checked(NameStr(*username));
mode = convert_function_priv_string(priv_type_text);
- if (!SearchSysCacheExists(PROCOID,
- ObjectIdGetDatum(functionoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(PROCOID, ObjectIdGetDatum(functionoid)))
PG_RETURN_NULL();
aclresult = pg_proc_aclcheck(functionoid, roleid, mode);
roleid = GetUserId();
mode = convert_function_priv_string(priv_type_text);
- if (!SearchSysCacheExists(PROCOID,
- ObjectIdGetDatum(functionoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(PROCOID, ObjectIdGetDatum(functionoid)))
PG_RETURN_NULL();
aclresult = pg_proc_aclcheck(functionoid, roleid, mode);
mode = convert_function_priv_string(priv_type_text);
- if (!SearchSysCacheExists(PROCOID,
- ObjectIdGetDatum(functionoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(PROCOID, ObjectIdGetDatum(functionoid)))
PG_RETURN_NULL();
aclresult = pg_proc_aclcheck(functionoid, roleid, mode);
roleid = get_roleid_checked(NameStr(*username));
mode = convert_language_priv_string(priv_type_text);
- if (!SearchSysCacheExists(LANGOID,
- ObjectIdGetDatum(languageoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(LANGOID, ObjectIdGetDatum(languageoid)))
PG_RETURN_NULL();
aclresult = pg_language_aclcheck(languageoid, roleid, mode);
roleid = GetUserId();
mode = convert_language_priv_string(priv_type_text);
- if (!SearchSysCacheExists(LANGOID,
- ObjectIdGetDatum(languageoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(LANGOID, ObjectIdGetDatum(languageoid)))
PG_RETURN_NULL();
aclresult = pg_language_aclcheck(languageoid, roleid, mode);
mode = convert_language_priv_string(priv_type_text);
- if (!SearchSysCacheExists(LANGOID,
- ObjectIdGetDatum(languageoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(LANGOID, ObjectIdGetDatum(languageoid)))
PG_RETURN_NULL();
aclresult = pg_language_aclcheck(languageoid, roleid, mode);
char *langname = text_to_cstring(languagename);
Oid oid;
- oid = GetSysCacheOid(LANGNAME,
- CStringGetDatum(langname),
- 0, 0, 0);
+ oid = GetSysCacheOid1(LANGNAME, CStringGetDatum(langname));
if (!OidIsValid(oid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
roleid = get_roleid_checked(NameStr(*username));
mode = convert_schema_priv_string(priv_type_text);
- if (!SearchSysCacheExists(NAMESPACEOID,
- ObjectIdGetDatum(schemaoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(NAMESPACEOID, ObjectIdGetDatum(schemaoid)))
PG_RETURN_NULL();
aclresult = pg_namespace_aclcheck(schemaoid, roleid, mode);
roleid = GetUserId();
mode = convert_schema_priv_string(priv_type_text);
- if (!SearchSysCacheExists(NAMESPACEOID,
- ObjectIdGetDatum(schemaoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(NAMESPACEOID, ObjectIdGetDatum(schemaoid)))
PG_RETURN_NULL();
aclresult = pg_namespace_aclcheck(schemaoid, roleid, mode);
mode = convert_schema_priv_string(priv_type_text);
- if (!SearchSysCacheExists(NAMESPACEOID,
- ObjectIdGetDatum(schemaoid),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(NAMESPACEOID, ObjectIdGetDatum(schemaoid)))
PG_RETURN_NULL();
aclresult = pg_namespace_aclcheck(schemaoid, roleid, mode);
char *nspname = text_to_cstring(schemaname);
Oid oid;
- oid = GetSysCacheOid(NAMESPACENAME,
- CStringGetDatum(nspname),
- 0, 0, 0);
+ oid = GetSysCacheOid1(NAMESPACENAME, CStringGetDatum(nspname));
if (!OidIsValid(oid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_SCHEMA),
bool result = false;
HeapTuple utup;
- utup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(roleid),
- 0, 0, 0);
+ utup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
if (HeapTupleIsValid(utup))
{
result = ((Form_pg_authid) GETSTRUCT(utup))->rolinherit;
continue;
/* Find roles that memberid is directly a member of */
- memlist = SearchSysCacheList(AUTHMEMMEMROLE, 1,
- ObjectIdGetDatum(memberid),
- 0, 0, 0);
+ memlist = SearchSysCacheList1(AUTHMEMMEMROLE,
+ ObjectIdGetDatum(memberid));
for (i = 0; i < memlist->n_members; i++)
{
HeapTuple tup = &memlist->members[i]->tuple;
int i;
/* Find roles that memberid is directly a member of */
- memlist = SearchSysCacheList(AUTHMEMMEMROLE, 1,
- ObjectIdGetDatum(memberid),
- 0, 0, 0);
+ memlist = SearchSysCacheList1(AUTHMEMMEMROLE,
+ ObjectIdGetDatum(memberid));
for (i = 0; i < memlist->n_members; i++)
{
HeapTuple tup = &memlist->members[i]->tuple;
int i;
/* Find roles that memberid is directly a member of */
- memlist = SearchSysCacheList(AUTHMEMMEMROLE, 1,
- ObjectIdGetDatum(memberid),
- 0, 0, 0);
+ memlist = SearchSysCacheList1(AUTHMEMMEMROLE,
+ ObjectIdGetDatum(memberid));
for (i = 0; i < memlist->n_members; i++)
{
HeapTuple tup = &memlist->members[i]->tuple;
* Copyright (c) 2002-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/dbsize.c,v 1.29 2010/02/07 20:48:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/dbsize.c,v 1.30 2010/02/14 18:42:16 rhaas Exp $
*
*/
HeapTuple tuple;
Form_pg_class relform;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tuple))
PG_RETURN_NULL();
relform = (Form_pg_class) GETSTRUCT(tuple);
RelFileNode rnode;
char *path;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tuple))
PG_RETURN_NULL();
relform = (Form_pg_class) GETSTRUCT(tuple);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/enum.c,v 1.9 2010/01/02 16:57:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/enum.c,v 1.10 2010/02/14 18:42:16 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
format_type_be(enumtypoid),
name)));
- tup = SearchSysCache(ENUMTYPOIDNAME,
- ObjectIdGetDatum(enumtypoid),
- CStringGetDatum(name),
- 0, 0);
+ tup = SearchSysCache2(ENUMTYPOIDNAME,
+ ObjectIdGetDatum(enumtypoid),
+ CStringGetDatum(name));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
HeapTuple tup;
Form_pg_enum en;
- tup = SearchSysCache(ENUMOID,
- ObjectIdGetDatum(enumval),
- 0, 0, 0);
+ tup = SearchSysCache1(ENUMOID, ObjectIdGetDatum(enumval));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
format_type_be(enumtypoid),
name)));
- tup = SearchSysCache(ENUMTYPOIDNAME,
- ObjectIdGetDatum(enumtypoid),
- CStringGetDatum(name),
- 0, 0);
+ tup = SearchSysCache2(ENUMTYPOIDNAME,
+ ObjectIdGetDatum(enumtypoid),
+ CStringGetDatum(name));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
HeapTuple tup;
Form_pg_enum en;
- tup = SearchSysCache(ENUMOID,
- ObjectIdGetDatum(enumval),
- 0, 0, 0);
+ tup = SearchSysCache1(ENUMOID, ObjectIdGetDatum(enumval));
if (!HeapTupleIsValid(tup))
ereport(ERROR,
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("could not determine actual enum type")));
- list = SearchSysCacheList(ENUMTYPOIDNAME, 1,
- ObjectIdGetDatum(enumtypoid),
- 0, 0, 0);
+ list = SearchSysCacheList1(ENUMTYPOIDNAME, ObjectIdGetDatum(enumtypoid));
num = list->n_members;
for (i = 0; i < num; i++)
{
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("could not determine actual enum type")));
- list = SearchSysCacheList(ENUMTYPOIDNAME, 1,
- ObjectIdGetDatum(enumtypoid),
- 0, 0, 0);
+ list = SearchSysCacheList1(ENUMTYPOIDNAME, ObjectIdGetDatum(enumtypoid));
num = list->n_members;
for (i = 0; i < num; i++)
{
j;
Datum *elems;
- list = SearchSysCacheList(ENUMTYPOIDNAME, 1,
- ObjectIdGetDatum(enumtypoid),
- 0, 0, 0);
+ list = SearchSysCacheList1(ENUMTYPOIDNAME, ObjectIdGetDatum(enumtypoid));
total = list->n_members;
elems = (Datum *) palloc(total * sizeof(Datum));
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/format_type.c,v 1.52 2010/01/02 16:57:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/format_type.c,v 1.53 2010/02/14 18:42:16 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
if (type_oid == InvalidOid && allow_invalid)
return pstrdup("-");
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_oid));
if (!HeapTupleIsValid(tuple))
{
if (allow_invalid)
{
/* Switch our attention to the array element type */
ReleaseSysCache(tuple);
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(array_base_type),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(array_base_type));
if (!HeapTupleIsValid(tuple))
{
if (allow_invalid)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/regproc.c,v 1.112 2010/01/02 16:57:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/regproc.c,v 1.113 2010/02/14 18:42:16 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
PG_RETURN_CSTRING(result);
}
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(proid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(proid));
if (HeapTupleIsValid(proctup))
{
char *result;
HeapTuple proctup;
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(procedure_oid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(procedure_oid));
if (HeapTupleIsValid(proctup))
{
PG_RETURN_CSTRING(result);
}
- opertup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(oprid),
- 0, 0, 0);
+ opertup = SearchSysCache1(OPEROID, ObjectIdGetDatum(oprid));
if (HeapTupleIsValid(opertup))
{
char *result;
HeapTuple opertup;
- opertup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(operator_oid),
- 0, 0, 0);
+ opertup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operator_oid));
if (HeapTupleIsValid(opertup))
{
PG_RETURN_CSTRING(result);
}
- classtup = SearchSysCache(RELOID,
- ObjectIdGetDatum(classid),
- 0, 0, 0);
+ classtup = SearchSysCache1(RELOID, ObjectIdGetDatum(classid));
if (HeapTupleIsValid(classtup))
{
PG_RETURN_CSTRING(result);
}
- typetup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ typetup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(typetup))
{
PG_RETURN_CSTRING(result);
}
- cfgtup = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfgid),
- 0, 0, 0);
+ cfgtup = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgid));
if (HeapTupleIsValid(cfgtup))
{
PG_RETURN_CSTRING(result);
}
- dicttup = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dictid),
- 0, 0, 0);
+ dicttup = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dictid));
if (HeapTupleIsValid(dicttup))
{
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.117 2010/01/02 16:57:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.118 2010/02/14 18:42:16 rhaas Exp $
*
* ----------
*/
char *oprname;
char *nspname;
- opertup = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opoid),
- 0, 0, 0);
+ opertup = SearchSysCache1(OPEROID, ObjectIdGetDatum(opoid));
if (!HeapTupleIsValid(opertup))
elog(ERROR, "cache lookup failed for operator %u", opoid);
operform = (Form_pg_operator) GETSTRUCT(opertup);
char *typname;
char *nspname;
- typetup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ typetup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(typetup))
elog(ERROR, "cache lookup failed for type %u", typid);
typform = (Form_pg_type) GETSTRUCT(typetup);
errhint("Remove this referential integrity trigger and its mates, then do ALTER TABLE ADD CONSTRAINT.")));
/* OK, fetch the tuple */
- tup = SearchSysCache(CONSTROID,
- ObjectIdGetDatum(constraintOid),
- 0, 0, 0);
+ tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(constraintOid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for constraint %u", constraintOid);
conForm = (Form_pg_constraint) GETSTRUCT(tup);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.321 2010/02/12 17:33:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.322 2010/02/14 18:42:16 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Fetch the pg_index tuple by the Oid of the index
*/
- ht_idx = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(indexrelid),
- 0, 0, 0);
+ ht_idx = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexrelid));
if (!HeapTupleIsValid(ht_idx))
elog(ERROR, "cache lookup failed for index %u", indexrelid);
idxrec = (Form_pg_index) GETSTRUCT(ht_idx);
/*
* Fetch the pg_class tuple of the index relation
*/
- ht_idxrel = SearchSysCache(RELOID,
- ObjectIdGetDatum(indexrelid),
- 0, 0, 0);
+ ht_idxrel = SearchSysCache1(RELOID, ObjectIdGetDatum(indexrelid));
if (!HeapTupleIsValid(ht_idxrel))
elog(ERROR, "cache lookup failed for relation %u", indexrelid);
idxrelrec = (Form_pg_class) GETSTRUCT(ht_idxrel);
/*
* Fetch the pg_am tuple of the index' access method
*/
- ht_am = SearchSysCache(AMOID,
- ObjectIdGetDatum(idxrelrec->relam),
- 0, 0, 0);
+ ht_am = SearchSysCache1(AMOID, ObjectIdGetDatum(idxrelrec->relam));
if (!HeapTupleIsValid(ht_am))
elog(ERROR, "cache lookup failed for access method %u",
idxrelrec->relam);
Form_pg_constraint conForm;
StringInfoData buf;
- tup = SearchSysCache(CONSTROID,
- ObjectIdGetDatum(constraintId),
- 0, 0, 0);
+ tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(constraintId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for constraint %u", constraintId);
conForm = (Form_pg_constraint) GETSTRUCT(tup);
/*
* Get the pg_authid entry and print the result
*/
- roletup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(roleid),
- 0, 0, 0);
+ roletup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
if (HeapTupleIsValid(roletup))
{
role_rec = (Form_pg_authid) GETSTRUCT(roletup);
char *result;
/* Get the sequence's pg_class entry */
- classtup = SearchSysCache(RELOID,
- ObjectIdGetDatum(sequenceId),
- 0, 0, 0);
+ classtup = SearchSysCache1(RELOID, ObjectIdGetDatum(sequenceId));
if (!HeapTupleIsValid(classtup))
elog(ERROR, "cache lookup failed for relation %u", sequenceId);
classtuple = (Form_pg_class) GETSTRUCT(classtup);
initStringInfo(&buf);
/* Look up the function */
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
proc = (Form_pg_proc) GETSTRUCT(proctup);
errmsg("\"%s\" is an aggregate function", name)));
/* Need its pg_language tuple for the language name */
- langtup = SearchSysCache(LANGOID,
- ObjectIdGetDatum(proc->prolang),
- 0, 0, 0);
+ langtup = SearchSysCache1(LANGOID, ObjectIdGetDatum(proc->prolang));
if (!HeapTupleIsValid(langtup))
elog(ERROR, "cache lookup failed for language %u", proc->prolang);
lang = (Form_pg_language) GETSTRUCT(langtup);
initStringInfo(&buf);
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
initStringInfo(&buf);
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
initStringInfo(&buf);
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
HeapTuple tp;
Form_pg_operator optup;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for operator %u", opno);
optup = (Form_pg_operator) GETSTRUCT(tp);
char *opcname;
char *nspname;
- 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);
opcrec = (Form_pg_opclass) GETSTRUCT(ht_opc);
char *nspname;
char *result;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for relation %u", relid);
reltup = (Form_pg_class) GETSTRUCT(tp);
int p_nvargs;
Oid *p_true_typeids;
- proctup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
procform = (Form_pg_proc) GETSTRUCT(proctup);
initStringInfo(&buf);
- 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);
operform = (Form_pg_operator) GETSTRUCT(opertup);
Datum reloptions;
bool isnull;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.268 2010/01/05 21:53:59 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.269 2010/02/14 18:42:16 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
}
else if (rte->rtekind == RTE_RELATION)
{
- vardata->statsTuple = SearchSysCache(STATRELATTINH,
- ObjectIdGetDatum(rte->relid),
- Int16GetDatum(var->varattno),
- BoolGetDatum(rte->inh),
- 0);
+ vardata->statsTuple = SearchSysCache3(STATRELATTINH,
+ ObjectIdGetDatum(rte->relid),
+ Int16GetDatum(var->varattno),
+ BoolGetDatum(rte->inh));
vardata->freefunc = ReleaseSysCache;
}
else
else if (index->indpred == NIL)
{
vardata->statsTuple =
- SearchSysCache(STATRELATTINH,
+ SearchSysCache3(STATRELATTINH,
ObjectIdGetDatum(index->indexoid),
- Int16GetDatum(pos + 1),
- BoolGetDatum(false),
- 0);
+ Int16GetDatum(pos + 1),
+ BoolGetDatum(false));
vardata->freefunc = ReleaseSysCache;
}
if (vardata->statsTuple)
}
else
{
- vardata.statsTuple = SearchSysCache(STATRELATTINH,
- ObjectIdGetDatum(relid),
- Int16GetDatum(colnum),
- BoolGetDatum(rte->inh),
- 0);
+ vardata.statsTuple = SearchSysCache3(STATRELATTINH,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(colnum),
+ BoolGetDatum(rte->inh));
vardata.freefunc = ReleaseSysCache;
}
}
}
else
{
- vardata.statsTuple = SearchSysCache(STATRELATTINH,
- ObjectIdGetDatum(relid),
- Int16GetDatum(colnum),
- BoolGetDatum(false),
- 0);
+ vardata.statsTuple = SearchSysCache3(STATRELATTINH,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(colnum),
+ BoolGetDatum(false));
vardata.freefunc = ReleaseSysCache;
}
}
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.95 2010/01/02 16:57:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.96 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
HeapTuple tuple;
Form_pg_class reltuple;
- tuple = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", relid);
reltuple = (Form_pg_class) GETSTRUCT(tuple);
HeapTuple tuple;
Form_pg_type typtuple;
- tuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typeoid),
- 0, 0, 0);
+ tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typeoid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for type %u", typeoid);
typtuple = (Form_pg_type) GETSTRUCT(tuple);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/attoptcache.c,v 1.1 2010/01/22 16:42:31 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/attoptcache.c,v 1.2 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
{
AttributeOpts *opts;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(attrelid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(attrelid),
+ Int16GetDatum(attnum));
/*
* If we don't find a valid HeapTuple, it must mean someone has
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.150 2010/02/08 05:53:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.151 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
static uint32
CatalogCacheComputeTupleHashValue(CatCache *cache, HeapTuple tuple)
{
- ScanKeyData cur_skey[4];
+ ScanKeyData cur_skey[CATCACHE_MAXKEYS];
bool isNull = false;
/* Copy pre-initialized overhead data for scankey */
Datum v3,
Datum v4)
{
- ScanKeyData cur_skey[4];
+ ScanKeyData cur_skey[CATCACHE_MAXKEYS];
uint32 hashValue;
Index hashIndex;
Dlelem *elt;
Datum v3,
Datum v4)
{
- ScanKeyData cur_skey[4];
+ ScanKeyData cur_skey[CATCACHE_MAXKEYS];
uint32 lHashValue;
Dlelem *elt;
CatCList *cl;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.96 2010/02/13 16:15:47 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.97 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
{
HeapTuple tup;
- tup = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tup = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for relation %u", relid);
CacheInvalidateRelcacheByTuple(tup);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.166 2010/01/04 02:44:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.167 2010/02/14 18:42:17 rhaas Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
bool
op_in_opfamily(Oid opno, Oid opfamily)
{
- return SearchSysCacheExists(AMOPOPID,
- ObjectIdGetDatum(opno),
- ObjectIdGetDatum(opfamily),
- 0, 0);
+ return SearchSysCacheExists2(AMOPOPID,
+ ObjectIdGetDatum(opno),
+ ObjectIdGetDatum(opfamily));
}
/*
Form_pg_amop amop_tup;
int result;
- tp = SearchSysCache(AMOPOPID,
- ObjectIdGetDatum(opno),
- ObjectIdGetDatum(opfamily),
- 0, 0);
+ tp = SearchSysCache2(AMOPOPID,
+ ObjectIdGetDatum(opno),
+ ObjectIdGetDatum(opfamily));
if (!HeapTupleIsValid(tp))
return 0;
amop_tup = (Form_pg_amop) GETSTRUCT(tp);
HeapTuple tp;
Form_pg_amop amop_tup;
- tp = SearchSysCache(AMOPOPID,
- ObjectIdGetDatum(opno),
- ObjectIdGetDatum(opfamily),
- 0, 0);
+ tp = SearchSysCache2(AMOPOPID,
+ ObjectIdGetDatum(opno),
+ ObjectIdGetDatum(opfamily));
if (!HeapTupleIsValid(tp))
elog(ERROR, "operator %u is not a member of opfamily %u",
opno, opfamily);
Form_pg_amop amop_tup;
Oid result;
- tp = SearchSysCache(AMOPSTRATEGY,
- ObjectIdGetDatum(opfamily),
- ObjectIdGetDatum(lefttype),
- ObjectIdGetDatum(righttype),
- Int16GetDatum(strategy));
+ tp = SearchSysCache4(AMOPSTRATEGY,
+ ObjectIdGetDatum(opfamily),
+ ObjectIdGetDatum(lefttype),
+ ObjectIdGetDatum(righttype),
+ Int16GetDatum(strategy));
if (!HeapTupleIsValid(tp))
return InvalidOid;
amop_tup = (Form_pg_amop) GETSTRUCT(tp);
* Search pg_amop to see if the target operator is registered as the "<"
* or ">" operator of any btree opfamily.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno));
for (i = 0; i < catlist->n_members; i++)
{
* Search pg_amop to see if the target operator is registered as the "="
* operator of any btree opfamily.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno));
for (i = 0; i < catlist->n_members; i++)
{
* Search pg_amop to see if the target operator is registered as the "="
* operator of any btree opfamily.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno));
for (i = 0; i < catlist->n_members; i++)
{
* operator of any hash opfamily. If the operator is registered in
* multiple opfamilies, assume we can use any one.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno));
for (i = 0; i < catlist->n_members; i++)
{
* operator of any hash opfamily. If the operator is registered in
* multiple opfamilies, assume we can use any one.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno));
for (i = 0; i < catlist->n_members; i++)
{
/*
* Find all the pg_amop entries containing the operator.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno));
/*
* If we can't find any opfamily containing the op, perhaps it is a <>
{
op_negated = true;
ReleaseSysCacheList(catlist);
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(op_negator),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID,
+ ObjectIdGetDatum(op_negator));
}
}
/*
* We search through all the pg_amop entries for opno1.
*/
- catlist = SearchSysCacheList(AMOPOPID, 1,
- ObjectIdGetDatum(opno1),
- 0, 0, 0);
+ catlist = SearchSysCacheList1(AMOPOPID, ObjectIdGetDatum(opno1));
result = false;
for (i = 0; i < catlist->n_members; i++)
Form_pg_amproc amproc_tup;
RegProcedure result;
- tp = SearchSysCache(AMPROCNUM,
- ObjectIdGetDatum(opfamily),
- ObjectIdGetDatum(lefttype),
- ObjectIdGetDatum(righttype),
- Int16GetDatum(procnum));
+ tp = SearchSysCache4(AMPROCNUM,
+ ObjectIdGetDatum(opfamily),
+ ObjectIdGetDatum(lefttype),
+ ObjectIdGetDatum(righttype),
+ Int16GetDatum(procnum));
if (!HeapTupleIsValid(tp))
return InvalidOid;
amproc_tup = (Form_pg_amproc) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(attnum));
if (HeapTupleIsValid(tp))
{
Form_pg_attribute att_tup = (Form_pg_attribute) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(attnum));
if (HeapTupleIsValid(tp))
{
Form_pg_attribute att_tup = (Form_pg_attribute) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(attnum));
if (HeapTupleIsValid(tp))
{
Form_pg_attribute att_tup = (Form_pg_attribute) GETSTRUCT(tp);
HeapTuple tp;
Form_pg_attribute att_tup;
- tp = SearchSysCache(ATTNUM,
- ObjectIdGetDatum(relid),
- Int16GetDatum(attnum),
- 0, 0);
+ tp = SearchSysCache2(ATTNUM,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(attnum));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, relid);
{
HeapTuple tp;
- tp = SearchSysCache(CONSTROID,
- ObjectIdGetDatum(conoid),
- 0, 0, 0);
+ tp = SearchSysCache1(CONSTROID, ObjectIdGetDatum(conoid));
if (HeapTupleIsValid(tp))
{
Form_pg_constraint contup = (Form_pg_constraint) GETSTRUCT(tp);
Form_pg_opclass cla_tup;
Oid result;
- tp = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opclass),
- 0, 0, 0);
+ tp = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclass));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for opclass %u", opclass);
cla_tup = (Form_pg_opclass) GETSTRUCT(tp);
Form_pg_opclass cla_tup;
Oid result;
- tp = SearchSysCache(CLAOID,
- ObjectIdGetDatum(opclass),
- 0, 0, 0);
+ tp = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclass));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for opclass %u", opclass);
cla_tup = (Form_pg_opclass) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
HeapTuple tp;
Form_pg_operator optup;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (!HeapTupleIsValid(tp)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for operator %u", opno);
optup = (Form_pg_operator) GETSTRUCT(tp);
HeapTuple tp;
bool result = false;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
HeapTuple tp;
bool result = false;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(OPEROID,
- ObjectIdGetDatum(opno),
- 0, 0, 0);
+ tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (HeapTupleIsValid(tp))
{
Form_pg_proc functup = (Form_pg_proc) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcid),
- 0, 0, 0);
+ tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (HeapTupleIsValid(tp))
{
Form_pg_proc functup = (Form_pg_proc) GETSTRUCT(tp);
HeapTuple tp;
Oid result;
- 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);
HeapTuple tp;
int result;
- 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);
Form_pg_proc procstruct;
Oid result;
- 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);
HeapTuple tp;
bool result;
- 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);
HeapTuple tp;
bool result;
- 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);
HeapTuple tp;
char result;
- 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);
HeapTuple tp;
float4 result;
- 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);
HeapTuple tp;
float4 result;
- 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);
Oid
get_relname_relid(const char *relname, Oid relnamespace)
{
- return GetSysCacheOid(RELNAMENSP,
- PointerGetDatum(relname),
- ObjectIdGetDatum(relnamespace),
- 0, 0);
+ return GetSysCacheOid2(RELNAMENSP,
+ PointerGetDatum(relname),
+ ObjectIdGetDatum(relnamespace));
}
#ifdef NOT_USED
{
HeapTuple tp;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (HeapTupleIsValid(tp))
{
Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (HeapTupleIsValid(tp))
{
Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (HeapTupleIsValid(tp))
{
Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (HeapTupleIsValid(tp))
{
Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (HeapTupleIsValid(tp))
{
Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
+ tp = SearchSysCache1(RELOID, ObjectIdGetDatum(relid));
if (HeapTupleIsValid(tp))
{
Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
HeapTuple tp;
Form_pg_type typtup;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for type %u", typid);
typtup = (Form_pg_type) GETSTRUCT(tp);
HeapTuple tp;
Form_pg_type typtup;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for type %u", typid);
typtup = (Form_pg_type) GETSTRUCT(tp);
return;
}
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", typid);
typeStruct = (Form_pg_type) GETSTRUCT(typeTuple);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
bool isNull;
Node *expr;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", typid);
type = (Form_pg_type) GETSTRUCT(typeTuple);
HeapTuple tup;
Form_pg_type typTup;
- tup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for type %u", typid);
typTup = (Form_pg_type) GETSTRUCT(tup);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
HeapTuple tp;
Form_pg_type typtup;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for type %u", typid);
typtup = (Form_pg_type) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
HeapTuple tp;
Oid result = InvalidOid;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
result = ((Form_pg_type) GETSTRUCT(tp))->typarray;
HeapTuple typeTuple;
Form_pg_type pt;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", type);
pt = (Form_pg_type) GETSTRUCT(typeTuple);
HeapTuple typeTuple;
Form_pg_type pt;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", type);
pt = (Form_pg_type) GETSTRUCT(typeTuple);
HeapTuple typeTuple;
Form_pg_type pt;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", type);
pt = (Form_pg_type) GETSTRUCT(typeTuple);
HeapTuple typeTuple;
Form_pg_type pt;
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", type);
pt = (Form_pg_type) GETSTRUCT(typeTuple);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
{
HeapTuple tp;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typid),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
if (stawidth > 0)
return stawidth;
}
- tp = SearchSysCache(STATRELATTINH,
- ObjectIdGetDatum(relid),
- Int16GetDatum(attnum),
- BoolGetDatum(false),
- 0);
+ tp = SearchSysCache3(STATRELATTINH,
+ ObjectIdGetDatum(relid),
+ Int16GetDatum(attnum),
+ BoolGetDatum(false));
if (HeapTupleIsValid(tp))
{
stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth;
statarray = DatumGetArrayTypeP(val);
/* Need to get info about the array element type */
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(atttype),
- 0, 0, 0);
+ typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(atttype));
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "cache lookup failed for type %u", atttype);
typeForm = (Form_pg_type) GETSTRUCT(typeTuple);
{
HeapTuple tp;
- tp = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(nspid),
- 0, 0, 0);
+ tp = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(nspid));
if (HeapTupleIsValid(tp))
{
Form_pg_namespace nsptup = (Form_pg_namespace) GETSTRUCT(tp);
Oid
get_roleid(const char *rolname)
{
- return GetSysCacheOid(AUTHNAME,
- PointerGetDatum(rolname),
- 0, 0, 0);
+ return GetSysCacheOid1(AUTHNAME, PointerGetDatum(rolname));
}
/*
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.305 2010/02/09 21:43:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.306 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* contains variable-length and possibly-null fields, we have to do this
* honestly rather than just treating it as a Form_pg_index struct.
*/
- tuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(RelationGetRelid(relation)),
- 0, 0, 0);
+ tuple = SearchSysCache1(INDEXRELID,
+ ObjectIdGetDatum(RelationGetRelid(relation)));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for index %u",
RelationGetRelid(relation));
/*
* Make a copy of the pg_am entry for the index's access method
*/
- tuple = SearchSysCache(AMOID,
- ObjectIdGetDatum(relation->rd_rel->relam),
- 0, 0, 0);
+ tuple = SearchSysCache1(AMOID, ObjectIdGetDatum(relation->rd_rel->relam));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for access method %u",
relation->rd_rel->relam);
HeapTuple tuple;
Form_pg_index index;
- tuple = SearchSysCache(INDEXRELID,
- ObjectIdGetDatum(RelationGetRelid(relation)),
- 0, 0, 0);
+ tuple = SearchSysCache1(INDEXRELID,
+ ObjectIdGetDatum(RelationGetRelid(relation)));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for index %u",
RelationGetRelid(relation));
*/
pg_class = heap_open(RelationRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy(RELOID,
- ObjectIdGetDatum(RelationGetRelid(relation)),
- 0, 0, 0);
+ tuple = SearchSysCacheCopy1(RELOID,
+ ObjectIdGetDatum(RelationGetRelid(relation)));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "could not find tuple for relation %u",
RelationGetRelid(relation));
HeapTuple htup;
Form_pg_class relp;
- htup = SearchSysCache(RELOID,
- ObjectIdGetDatum(RelationGetRelid(relation)),
- 0, 0, 0);
+ htup = SearchSysCache1(RELOID,
+ ObjectIdGetDatum(RelationGetRelid(relation)));
if (!HeapTupleIsValid(htup))
elog(FATAL, "cache lookup failed for relation %u",
RelationGetRelid(relation));
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/spccache.c,v 1.4 2010/01/07 03:53:08 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/spccache.c,v 1.5 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* details for a non-existent tablespace. We'll just treat that case as if
* no options were specified.
*/
- tp = SearchSysCache(TABLESPACEOID,
- ObjectIdGetDatum(spcid),
- 0, 0, 0);
+ tp = SearchSysCache1(TABLESPACEOID, ObjectIdGetDatum(spcid));
if (!HeapTupleIsValid(tp))
opts = NULL;
else
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.125 2010/02/08 05:53:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.126 2010/02/14 18:42:17 rhaas Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
{
HeapTuple tuple;
- tuple = SearchSysCache(ATTNAME,
- ObjectIdGetDatum(relid),
- CStringGetDatum(attname),
- 0, 0);
+ tuple = SearchSysCache2(ATTNAME,
+ ObjectIdGetDatum(relid),
+ CStringGetDatum(attname));
if (!HeapTupleIsValid(tuple))
return NULL;
if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
* Copyright (c) 2006-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.11 2010/01/02 16:57:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.12 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
HeapTuple tp;
Form_pg_ts_parser prs;
- tp = SearchSysCache(TSPARSEROID,
- ObjectIdGetDatum(prsId),
- 0, 0, 0);
+ tp = SearchSysCache1(TSPARSEROID, ObjectIdGetDatum(prsId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for text search parser %u",
prsId);
Form_pg_ts_template template;
MemoryContext saveCtx;
- tpdict = SearchSysCache(TSDICTOID,
- ObjectIdGetDatum(dictId),
- 0, 0, 0);
+ tpdict = SearchSysCache1(TSDICTOID, ObjectIdGetDatum(dictId));
if (!HeapTupleIsValid(tpdict))
elog(ERROR, "cache lookup failed for text search dictionary %u",
dictId);
/*
* Retrieve dictionary's template
*/
- tptmpl = SearchSysCache(TSTEMPLATEOID,
- ObjectIdGetDatum(dict->dicttemplate),
- 0, 0, 0);
+ tptmpl = SearchSysCache1(TSTEMPLATEOID,
+ ObjectIdGetDatum(dict->dicttemplate));
if (!HeapTupleIsValid(tptmpl))
elog(ERROR, "cache lookup failed for text search template %u",
dict->dicttemplate);
int ndicts;
int i;
- tp = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfgId),
- 0, 0, 0);
+ tp = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgId));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for text search configuration %u",
cfgId);
* Modify the actually stored value to be fully qualified, to ensure
* later changes of search_path don't affect it.
*/
- tuple = SearchSysCache(TSCONFIGOID,
- ObjectIdGetDatum(cfgId),
- 0, 0, 0);
+ tuple = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for text search configuration %u",
cfgId);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/typcache.c,v 1.31 2010/01/02 16:57:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/typcache.c,v 1.32 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
HeapTuple tp;
Form_pg_type typtup;
- tp = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type_id),
- 0, 0, 0);
+ tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id));
if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for type %u", type_id);
typtup = (Form_pg_type) GETSTRUCT(tp);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.129 2010/01/07 04:53:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.130 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
}
/* Otherwise we need the pg_proc entry */
- procedureTuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(functionId),
- 0, 0, 0);
+ procedureTuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(functionId));
if (!HeapTupleIsValid(procedureTuple))
elog(ERROR, "cache lookup failed for function %u", functionId);
procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple);
Form_pg_language languageStruct;
FmgrInfo plfinfo;
- languageTuple = SearchSysCache(LANGOID,
- ObjectIdGetDatum(language),
- 0, 0, 0);
+ languageTuple = SearchSysCache1(LANGOID, ObjectIdGetDatum(language));
if (!HeapTupleIsValid(languageTuple))
elog(ERROR, "cache lookup failed for language %u", language);
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
fcinfo->flinfo->fn_mcxt, true);
fcache->flinfo.fn_expr = fcinfo->flinfo->fn_expr;
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(fcinfo->flinfo->fn_oid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID,
+ ObjectIdGetDatum(fcinfo->flinfo->fn_oid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u",
fcinfo->flinfo->fn_oid);
* Copyright (c) 2002-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.47 2010/01/02 16:57:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.48 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
TupleDesc tupdesc;
/* First fetch the function's pg_proc row to inspect its rettype */
- 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);
procform = (Form_pg_proc) GETSTRUCT(tp);
int i;
/* First fetch the function's pg_proc row */
- procTuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(functionId),
- 0, 0, 0);
+ procTuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(functionId));
if (!HeapTupleIsValid(procTuple))
elog(ERROR, "cache lookup failed for function %u", functionId);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.181 2010/02/07 20:48:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.182 2010/02/14 18:42:17 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/* call only once */
AssertState(!OidIsValid(AuthenticatedUserId));
- roleTup = SearchSysCache(AUTHNAME,
- PointerGetDatum(rolename),
- 0, 0, 0);
+ roleTup = SearchSysCache1(AUTHNAME, PointerGetDatum(rolename));
if (!HeapTupleIsValid(roleTup))
ereport(FATAL,
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
HeapTuple tuple;
char *result;
- tuple = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(roleid),
- 0, 0, 0);
+ tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.202 2010/02/05 20:26:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.203 2010/02/14 18:42:18 rhaas Exp $
*
*
*-------------------------------------------------------------------------
char *ctype;
/* Fetch our pg_database row normally, via syscache */
- tup = SearchSysCache(DATABASEOID,
- ObjectIdGetDatum(MyDatabaseId),
- 0, 0, 0);
+ tup = SearchSysCache1(DATABASEOID, ObjectIdGetDatum(MyDatabaseId));
if (!HeapTupleIsValid(tup))
elog(ERROR, "cache lookup failed for database %u", MyDatabaseId);
dbform = (Form_pg_database) GETSTRUCT(tup);
*
* Tatsuo Ishii
*
- * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.92 2009/11/12 02:46:16 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.93 2010/02/14 18:42:18 rhaas Exp $
*/
#include "postgres.h"
* are going into infinite loop! So we have to make sure that the
* function exists before calling OidFunctionCall.
*/
- if (!SearchSysCacheExists(PROCOID,
- ObjectIdGetDatum(proc),
- 0, 0, 0))
+ if (!SearchSysCacheExists1(PROCOID, ObjectIdGetDatum(proc)))
{
elog(LOG, "cache lookup failed for function %u", proc);
return src;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/superuser.c,v 1.40 2010/01/02 16:57:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/superuser.c,v 1.41 2010/02/14 18:42:18 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
return true;
/* OK, look up the information in pg_authid */
- rtup = SearchSysCache(AUTHOID,
- ObjectIdGetDatum(roleid),
- 0, 0, 0);
+ rtup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
if (HeapTupleIsValid(rtup))
{
result = ((Form_pg_authid) GETSTRUCT(rtup))->rolsuper;
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/catcache.h,v 1.71 2010/02/08 05:53:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/catcache.h,v 1.72 2010/02/14 18:42:18 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
* struct catcacheheader: information for managing all the caches.
*/
+#define CATCACHE_MAXKEYS 4
+
typedef struct catcache
{
int id; /* cache identifier --- see syscache.h */
TupleDesc cc_tupdesc; /* tuple descriptor (copied from reldesc) */
int cc_ntup; /* # of tuples currently in this cache */
int cc_nbuckets; /* # of hash buckets in this cache */
- int cc_nkeys; /* # of keys (1..4) */
- int cc_key[4]; /* AttrNumber of each key */
- PGFunction cc_hashfunc[4]; /* hash function to use for each key */
- ScanKeyData cc_skey[4]; /* precomputed key info for heap scans */
- bool cc_isname[4]; /* flag key columns that are NAMEs */
+ int cc_nkeys; /* # of keys (1..CATCACHE_MAXKEYS) */
+ int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */
+ PGFunction cc_hashfunc[CATCACHE_MAXKEYS]; /* hash function for each key */
+ ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for heap scans */
+ bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */
Dllist cc_lists; /* list of CatCList structs */
#ifdef CATCACHE_STATS
long cc_searches; /* total # searches against this cache */
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.78 2010/01/05 21:54:00 rhaas Exp $
+ * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.79 2010/02/14 18:42:18 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
extern struct catclist *SearchSysCacheList(int cacheId, int nkeys,
Datum key1, Datum key2, Datum key3, Datum key4);
+/*
+ * The use of the macros below rather than direct calls to the corresponding
+ * functions is encouraged, as it insulates the caller from changes in the
+ * maximum number of keys.
+ */
+#define SearchSysCache1(cacheId, key1) \
+ SearchSysCache(cacheId, key1, 0, 0, 0)
+#define SearchSysCache2(cacheId, key1, key2) \
+ SearchSysCache(cacheId, key1, key2, 0, 0)
+#define SearchSysCache3(cacheId, key1, key2, key3) \
+ SearchSysCache(cacheId, key1, key2, key3, 0)
+#define SearchSysCache4(cacheId, key1, key2, key3, key4) \
+ SearchSysCache(cacheId, key1, key2, key3, key4)
+
+#define SearchSysCacheCopy1(cacheId, key1) \
+ SearchSysCacheCopy(cacheId, key1, 0, 0, 0)
+#define SearchSysCacheCopy2(cacheId, key1, key2) \
+ SearchSysCacheCopy(cacheId, key1, key2, 0, 0)
+#define SearchSysCacheCopy3(cacheId, key1, key2, key3) \
+ SearchSysCacheCopy(cacheId, key1, key2, key3, 0)
+#define SearchSysCacheCopy4(cacheId, key1, key2, key3, key4) \
+ SearchSysCacheCopy(cacheId, key1, key2, key3, key4)
+
+#define SearchSysCacheExists1(cacheId, key1) \
+ SearchSysCacheExists(cacheId, key1, 0, 0, 0)
+#define SearchSysCacheExists2(cacheId, key1, key2) \
+ SearchSysCacheExists(cacheId, key1, key2, 0, 0)
+#define SearchSysCacheExists3(cacheId, key1, key2, key3) \
+ SearchSysCacheExists(cacheId, key1, key2, key3, 0)
+#define SearchSysCacheExists4(cacheId, key1, key2, key3, key4) \
+ SearchSysCacheExists(cacheId, key1, key2, key3, key4)
+
+#define GetSysCacheOid1(cacheId, key1) \
+ GetSysCacheOid(cacheId, key1, 0, 0, 0)
+#define GetSysCacheOid2(cacheId, key1, key2) \
+ GetSysCacheOid(cacheId, key1, key2, 0, 0)
+#define GetSysCacheOid3(cacheId, key1, key2, key3) \
+ GetSysCacheOid(cacheId, key1, key2, key3, 0)
+#define GetSysCacheOid4(cacheId, key1, key2, key3, key4) \
+ GetSysCacheOid(cacheId, key1, key2, key3, key4)
+
+#define SearchSysCacheList1(cacheId, key1) \
+ SearchSysCacheList(cacheId, 1, key1, 0, 0, 0)
+#define SearchSysCacheList2(cacheId, key1, key2) \
+ SearchSysCacheList(cacheId, 2, key1, key2, 0, 0)
+#define SearchSysCacheList3(cacheId, key1, key2, key3) \
+ SearchSysCacheList(cacheId, 3, key1, key2, key3, 0)
+#define SearchSysCacheList4(cacheId, key1, key2, key3, key4) \
+ SearchSysCacheList(cacheId, 4, key1, key2, key3, key4)
+
#define ReleaseSysCacheList(x) ReleaseCatCacheList(x)
#endif /* SYSCACHE_H */
/**********************************************************************
* plperl.c - perl as a procedural language for PostgreSQL
*
- * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.165 2010/02/12 19:35:25 adunstan Exp $
+ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.166 2010/02/14 18:42:18 rhaas Exp $
*
**********************************************************************/
int i;
/* Get the new function's pg_proc entry */
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcoid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcoid);
proc = (Form_pg_proc) GETSTRUCT(tuple);
ErrorContextCallback plperl_error_context;
/* We'll need the pg_proc tuple in any case... */
- procTup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(fn_oid),
- 0, 0, 0);
+ procTup = SearchSysCache1(PROCOID, ObjectIdGetDatum(fn_oid));
if (!HeapTupleIsValid(procTup))
elog(ERROR, "cache lookup failed for function %u", fn_oid);
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
/************************************************************
* Lookup the pg_language tuple by Oid
************************************************************/
- langTup = SearchSysCache(LANGOID,
- ObjectIdGetDatum(procStruct->prolang),
- 0, 0, 0);
+ langTup = SearchSysCache1(LANGOID,
+ ObjectIdGetDatum(procStruct->prolang));
if (!HeapTupleIsValid(langTup))
{
free(prodesc->proname);
************************************************************/
if (!is_trigger)
{
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(procStruct->prorettype),
- 0, 0, 0);
+ typeTup =
+ SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(procStruct->prorettype));
if (!HeapTupleIsValid(typeTup))
{
free(prodesc->proname);
prodesc->nargs = procStruct->pronargs;
for (i = 0; i < prodesc->nargs; i++)
{
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(procStruct->proargtypes.values[i]),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(procStruct->proargtypes.values[i]));
if (!HeapTupleIsValid(typeTup))
{
free(prodesc->proname);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.148 2010/01/10 17:15:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.149 2010/02/14 18:42:18 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Lookup the pg_proc tuple by Oid; we'll need it in any case
*/
- procTup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcOid),
- 0, 0, 0);
+ procTup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcOid));
if (!HeapTupleIsValid(procTup))
elog(ERROR, "cache lookup failed for function %u", funcOid);
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
/*
* Lookup the function's return type
*/
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(rettypeid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(rettypeid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u", rettypeid);
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
else
goto done;
- classtup = SearchSysCache(RELOID,
- ObjectIdGetDatum(classOid),
- 0, 0, 0);
+ classtup = SearchSysCache1(RELOID, ObjectIdGetDatum(classOid));
if (!HeapTupleIsValid(classtup))
goto done;
classStruct = (Form_pg_class) GETSTRUCT(classtup);
goto done;
attrStruct = (Form_pg_attribute) GETSTRUCT(attrtup);
- typetup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(attrStruct->atttypid),
- 0, 0, 0);
+ typetup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(attrStruct->atttypid));
if (!HeapTupleIsValid(typetup))
elog(ERROR, "cache lookup failed for type %u", attrStruct->atttypid);
HeapTuple typeTup;
PLpgSQL_type *typ;
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typeOid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typeOid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u", typeOid);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_handler.c,v 1.49 2010/01/02 16:58:13 momjian Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_handler.c,v 1.50 2010/02/14 18:42:18 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
int i;
/* Get the new function's pg_proc entry */
- tuple = SearchSysCache(PROCOID,
- ObjectIdGetDatum(funcoid),
- 0, 0, 0);
+ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for function %u", funcoid);
proc = (Form_pg_proc) GETSTRUCT(tuple);
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.136 2010/01/22 15:45:15 petere Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.137 2010/02/14 18:42:19 rhaas Exp $
*
*********************************************************************
*/
int rv;
fn_oid = fcinfo->flinfo->fn_oid;
- procTup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(fn_oid),
- 0, 0, 0);
+ procTup = SearchSysCache1(PROCOID, ObjectIdGetDatum(fn_oid));
if (!HeapTupleIsValid(procTup))
elog(ERROR, "cache lookup failed for function %u", fn_oid);
HeapTuple rvTypeTup;
Form_pg_type rvTypeStruct;
- rvTypeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(procStruct->prorettype),
- 0, 0, 0);
+ rvTypeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(procStruct->prorettype));
if (!HeapTupleIsValid(rvTypeTup))
elog(ERROR, "cache lookup failed for type %u",
procStruct->prorettype);
Assert(types[i] == procStruct->proargtypes.values[pos]);
- argTypeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(types[i]),
- 0, 0, 0);
+ argTypeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(types[i]));
if (!HeapTupleIsValid(argTypeTup))
elog(ERROR, "cache lookup failed for type %u", types[i]);
argTypeStruct = (Form_pg_type) GETSTRUCT(argTypeTup);
if (arg->in.r.atts[i].typoid == desc->attrs[i]->atttypid)
continue; /* already set up this entry */
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(desc->attrs[i]->atttypid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(desc->attrs[i]->atttypid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u",
desc->attrs[i]->atttypid);
if (arg->out.r.atts[i].typoid == desc->attrs[i]->atttypid)
continue; /* already set up this entry */
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(desc->attrs[i]->atttypid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(desc->attrs[i]->atttypid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u",
desc->attrs[i]->atttypid);
parseTypeString(sptr, &typeId, &typmod);
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(typeId),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(typeId));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u", typeId);
* pltcl.c - PostgreSQL support for Tcl as
* procedural language (PL)
*
- * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.130 2010/01/25 01:58:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.131 2010/02/14 18:42:19 rhaas Exp $
*
**********************************************************************/
* Lookup the attribute type in the syscache
* for the input function
************************************************************/
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u",
tupdesc->attrs[attnum - 1]->atttypid);
int tcl_rc;
/* We'll need the pg_proc tuple in any case... */
- procTup = SearchSysCache(PROCOID,
- ObjectIdGetDatum(fn_oid),
- 0, 0, 0);
+ procTup = SearchSysCache1(PROCOID, ObjectIdGetDatum(fn_oid));
if (!HeapTupleIsValid(procTup))
elog(ERROR, "cache lookup failed for function %u", fn_oid);
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
/************************************************************
* Lookup the pg_language tuple by Oid
************************************************************/
- langTup = SearchSysCache(LANGOID,
- ObjectIdGetDatum(procStruct->prolang),
- 0, 0, 0);
+ langTup = SearchSysCache1(LANGOID,
+ ObjectIdGetDatum(procStruct->prolang));
if (!HeapTupleIsValid(langTup))
{
free(prodesc->user_proname);
************************************************************/
if (!is_trigger)
{
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(procStruct->prorettype),
- 0, 0, 0);
+ typeTup =
+ SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(procStruct->prorettype));
if (!HeapTupleIsValid(typeTup))
{
free(prodesc->user_proname);
proc_internal_args[0] = '\0';
for (i = 0; i < prodesc->nargs; i++)
{
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(procStruct->proargtypes.values[i]),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(procStruct->proargtypes.values[i]));
if (!HeapTupleIsValid(typeTup))
{
free(prodesc->user_proname);
* Lookup the attribute type in the syscache
* for the output function
************************************************************/
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(tupdesc->attrs[i]->atttypid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(tupdesc->attrs[i]->atttypid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u",
tupdesc->attrs[i]->atttypid);
* Lookup the attribute type in the syscache
* for the output function
************************************************************/
- typeTup = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(tupdesc->attrs[i]->atttypid),
- 0, 0, 0);
+ typeTup = SearchSysCache1(TYPEOID,
+ ObjectIdGetDatum(tupdesc->attrs[i]->atttypid));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u",
tupdesc->attrs[i]->atttypid);