From 2a990abd79acea4717cc8f982a28f35b6b347ddb Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Thu, 20 Jul 2023 15:18:25 +0900 Subject: Add missing ObjectIdGetDatum() in syscache lookup calls for Oids Based on how postgres.h foes the Oid <-> Datum conversion, there is no existing bugs but let's be consistent. 17 spots have been noticed as incorrectly passing down Oids rather than Datums. Aleksander got one, Zhang two and I the rest. Author: Michael Paquier, Aleksander Alekseev, Zhang Mingli Discussion: https://postgr.es/m/ZLUhqsqQN1MOaxdw@paquier.xyz --- src/backend/utils/adt/ruleutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/ruleutils.c') diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index d3a973d86b7..fcb2f45f623 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3283,7 +3283,7 @@ print_function_arguments(StringInfo buf, HeapTuple proctup, 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); -- cgit v1.2.3