indcoloptions = (int2vector *) DatumGetPointer(colOptionDatum);
/* Fetch options of index if any */
- classTuple = SearchSysCache1(RELOID, oldIndexId);
+ classTuple = SearchSysCache1(RELOID, ObjectIdGetDatum(oldIndexId));
if (!HeapTupleIsValid(classTuple))
elog(ERROR, "cache lookup failed for relation %u", oldIndexId);
optionDatum = SysCacheGetAttr(RELOID, classTuple,
}
else if (classId == SubscriptionRelationId)
{
- if (SearchSysCacheExists2(SUBSCRIPTIONNAME, MyDatabaseId,
+ if (SearchSysCacheExists2(SUBSCRIPTIONNAME,
+ ObjectIdGetDatum(MyDatabaseId),
CStringGetDatum(new_name)))
report_name_conflict(classId, new_name);
Form_pg_sequence pgsform;
List *options = NIL;
- pgstuple = SearchSysCache1(SEQRELID, relid);
+ pgstuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(pgstuple))
elog(ERROR, "cache lookup failed for sequence %u", relid);
pgsform = (Form_pg_sequence) GETSTRUCT(pgstuple);
memset(isnull, 0, sizeof(isnull));
- pgstuple = SearchSysCache1(SEQRELID, relid);
+ pgstuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(pgstuple))
elog(ERROR, "cache lookup failed for sequence %u", relid);
pgsform = (Form_pg_sequence) GETSTRUCT(pgstuple);
Oid deleteTriggerOid,
updateTriggerOid;
- tuple = SearchSysCache1(CONSTROID, constrOid);
+ tuple = SearchSysCache1(CONSTROID, ObjectIdGetDatum(constrOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for constraint %u", constrOid);
constrForm = (Form_pg_constraint) GETSTRUCT(tuple);
Oid insertTriggerOid,
updateTriggerOid;
- tuple = SearchSysCache1(CONSTROID, parentConstrOid);
+ tuple = SearchSysCache1(CONSTROID, ObjectIdGetDatum(parentConstrOid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for constraint %u",
parentConstrOid);
/* First, determine FDW validator associated to the foreign table. */
ftrel = table_open(ForeignTableRelationId, AccessShareLock);
- tuple = SearchSysCache1(FOREIGNTABLEREL, rel->rd_id);
+ tuple = SearchSysCache1(FOREIGNTABLEREL, ObjectIdGetDatum(rel->rd_id));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
ftrel = table_open(ForeignTableRelationId, RowExclusiveLock);
- tuple = SearchSysCacheCopy1(FOREIGNTABLEREL, rel->rd_id);
+ tuple = SearchSysCacheCopy1(FOREIGNTABLEREL,
+ ObjectIdGetDatum(rel->rd_id));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
HeapTuple mrtup;
Form_pg_authid mrform;
- mrtup = SearchSysCache1(AUTHOID, memberid);
+ mrtup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(memberid));
if (!HeapTupleIsValid(mrtup))
elog(ERROR, "cache lookup failed for role %u", memberid);
mrform = (Form_pg_authid) GETSTRUCT(mrtup);
Datum datum;
PartitionBoundSpec *bspec;
- tuple = SearchSysCache1(RELOID, inhrelid);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(inhrelid));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u", inhrelid);
PartitionBoundSpec *boundspec = NULL;
/* Try fetching the tuple from the catcache, for speed. */
- tuple = SearchSysCache1(RELOID, inhrelid);
+ tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(inhrelid));
if (HeapTupleIsValid(tuple))
{
Datum datum;
case ROLESPEC_CURRENT_ROLE:
case ROLESPEC_CURRENT_USER:
- tuple = SearchSysCache1(AUTHOID, GetUserId());
+ tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(GetUserId()));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for role %u", GetUserId());
break;
case ROLESPEC_SESSION_USER:
- tuple = SearchSysCache1(AUTHOID, GetSessionUserId());
+ tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(GetSessionUserId()));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for role %u", GetSessionUserId());
break;
HeapTuple aggtup;
Form_pg_aggregate agg;
- aggtup = SearchSysCache1(AGGFNOID, proc->oid);
+ aggtup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(proc->oid));
if (!HeapTupleIsValid(aggtup))
elog(ERROR, "cache lookup failed for aggregate %u",
proc->oid);
if (!list_member_oid(trftypes, typid))
return InvalidOid;
- tup = SearchSysCache2(TRFTYPELANG, typid, langid);
+ tup = SearchSysCache2(TRFTYPELANG, ObjectIdGetDatum(typid),
+ ObjectIdGetDatum(langid));
if (HeapTupleIsValid(tup))
{
Oid funcid;
if (!list_member_oid(trftypes, typid))
return InvalidOid;
- tup = SearchSysCache2(TRFTYPELANG, typid, langid);
+ tup = SearchSysCache2(TRFTYPELANG, ObjectIdGetDatum(typid),
+ ObjectIdGetDatum(langid));
if (HeapTupleIsValid(tup))
{
Oid funcid;
parent = relation_open(parentrelid, AccessShareLock);
/* Get pg_class.relpartbound */
- tuple = SearchSysCache1(RELOID, RelationGetRelid(rel));
+ tuple = SearchSysCache1(RELOID,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u",
RelationGetRelid(rel));