From: Peter Eisentraut Date: Mon, 20 Apr 2026 05:22:16 +0000 (+0200) Subject: Add missing Datum conversions X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=04f9ea372a20c0346ad6d78de348543375761aaa;p=thirdparty%2Fpostgresql.git Add missing Datum conversions Similar to commit ff89e182d42, for new code added since. --- diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index 9771c6a9b63..c1862809577 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -4146,7 +4146,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok) HeapTuple tuple; Form_pg_propgraph_label pglform; - tuple = SearchSysCache1(PROPGRAPHLABELOID, object->objectId); + tuple = SearchSysCache1(PROPGRAPHLABELOID, ObjectIdGetDatum(object->objectId)); if (!HeapTupleIsValid(tuple)) { if (!missing_ok) @@ -4206,7 +4206,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok) HeapTuple tuple; Form_pg_propgraph_property pgpform; - tuple = SearchSysCache1(PROPGRAPHPROPOID, object->objectId); + tuple = SearchSysCache1(PROPGRAPHPROPOID, ObjectIdGetDatum(object->objectId)); if (!HeapTupleIsValid(tuple)) { if (!missing_ok) @@ -6166,7 +6166,7 @@ getObjectIdentityParts(const ObjectAddress *object, HeapTuple tup; Form_pg_propgraph_element pge; - tup = SearchSysCache1(PROPGRAPHELOID, object->objectId); + tup = SearchSysCache1(PROPGRAPHELOID, ObjectIdGetDatum(object->objectId)); if (!HeapTupleIsValid(tup)) { if (!missing_ok) @@ -6189,7 +6189,7 @@ getObjectIdentityParts(const ObjectAddress *object, HeapTuple tup; Form_pg_propgraph_label pgl; - tup = SearchSysCache1(PROPGRAPHLABELOID, object->objectId); + tup = SearchSysCache1(PROPGRAPHLABELOID, ObjectIdGetDatum(object->objectId)); if (!HeapTupleIsValid(tup)) { if (!missing_ok) @@ -6211,7 +6211,7 @@ getObjectIdentityParts(const ObjectAddress *object, HeapTuple tup; Form_pg_propgraph_property pgp; - tup = SearchSysCache1(PROPGRAPHPROPOID, object->objectId); + tup = SearchSysCache1(PROPGRAPHPROPOID, ObjectIdGetDatum(object->objectId)); if (!HeapTupleIsValid(tup)) { if (!missing_ok) diff --git a/src/backend/catalog/pg_subscription.c b/src/backend/catalog/pg_subscription.c index 5a733585490..1f1fdc75af6 100644 --- a/src/backend/catalog/pg_subscription.c +++ b/src/backend/catalog/pg_subscription.c @@ -699,7 +699,7 @@ UpdateDeadTupleRetentionStatus(Oid subid, bool active) memset(replaces, false, sizeof(replaces)); /* Set the subscription to disabled. */ - values[Anum_pg_subscription_subretentionactive - 1] = active; + values[Anum_pg_subscription_subretentionactive - 1] = BoolGetDatum(active); replaces[Anum_pg_subscription_subretentionactive - 1] = true; /* Update the catalog */ diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 3a30d8ddb1f..d512e87cfe3 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -797,7 +797,7 @@ CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt, Int32GetDatum(opts.maxretention); values[Anum_pg_subscription_subretentionactive - 1] = Int32GetDatum(opts.retaindeadtuples); - values[Anum_pg_subscription_subserver - 1] = serverid; + values[Anum_pg_subscription_subserver - 1] = ObjectIdGetDatum(serverid); if (!OidIsValid(serverid)) values[Anum_pg_subscription_subconninfo - 1] = CStringGetTextDatum(conninfo); @@ -1855,7 +1855,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt, walrcv_check_conninfo(conninfo, sub->passwordrequired && !sub->ownersuperuser); - values[Anum_pg_subscription_subserver - 1] = new_server->serverid; + values[Anum_pg_subscription_subserver - 1] = ObjectIdGetDatum(new_server->serverid); replaces[Anum_pg_subscription_subserver - 1] = true; ObjectAddressSet(referenced, ForeignServerRelationId, new_server->serverid); @@ -1873,7 +1873,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt, DEPENDENCY_NORMAL, ForeignServerRelationId, form->subserver); - values[Anum_pg_subscription_subserver - 1] = InvalidOid; + values[Anum_pg_subscription_subserver - 1] = ObjectIdGetDatum(InvalidOid); replaces[Anum_pg_subscription_subserver - 1] = true; } diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 5afa781f086..05250eda472 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -5062,7 +5062,7 @@ get_partition_bound_spec(Oid partOid) PartitionBoundSpec *boundspec = NULL; /* Try fetching the tuple from the catcache, for speed. */ - tuple = SearchSysCache1(RELOID, partOid); + tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(partOid)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for relation %u", partOid); diff --git a/src/backend/postmaster/datachecksum_state.c b/src/backend/postmaster/datachecksum_state.c index 18797a8ee3d..213a909aa92 100644 --- a/src/backend/postmaster/datachecksum_state.c +++ b/src/backend/postmaster/datachecksum_state.c @@ -1295,7 +1295,7 @@ DatabaseExists(Oid dboid) ScanKeyInit(&skey, Anum_pg_database_oid, BTEqualStrategyNumber, F_OIDEQ, - dboid); + ObjectIdGetDatum(dboid)); scan = systable_beginscan(rel, DatabaseOidIndexId, true, SnapshotSelf, 1, &skey); tuple = systable_getnext(scan); diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index fa9fe9ffa26..1574f0c68c1 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -3941,7 +3941,7 @@ get_propgraph_label_name(Oid labeloid) HeapTuple tuple; char *labelname; - tuple = SearchSysCache1(PROPGRAPHLABELOID, labeloid); + tuple = SearchSysCache1(PROPGRAPHLABELOID, ObjectIdGetDatum(labeloid)); if (!tuple) { elog(ERROR, "cache lookup failed for label %u", labeloid); @@ -3959,7 +3959,7 @@ get_propgraph_property_name(Oid propoid) HeapTuple tuple; char *propname; - tuple = SearchSysCache1(PROPGRAPHPROPOID, propoid); + tuple = SearchSysCache1(PROPGRAPHPROPOID, ObjectIdGetDatum(propoid)); if (!tuple) { elog(ERROR, "cache lookup failed for property %u", propoid);