]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Add missing Datum conversions
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 20 Apr 2026 05:22:16 +0000 (07:22 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 20 Apr 2026 05:22:16 +0000 (07:22 +0200)
Similar to commit ff89e182d42, for new code added since.

src/backend/catalog/objectaddress.c
src/backend/catalog/pg_subscription.c
src/backend/commands/subscriptioncmds.c
src/backend/partitioning/partbounds.c
src/backend/postmaster/datachecksum_state.c
src/backend/utils/cache/lsyscache.c

index 9771c6a9b63ff33ffbc6861447ba822adba04f3b..c186280957781ede3ce560d95303b512ab1c12ea 100644 (file)
@@ -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)
index 5a733585490c4911a8f8f9b1be767a57e253b6f7..1f1fdc75af6f459e94ccb8a2ce1043f20d243533 100644 (file)
@@ -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 */
index 3a30d8ddb1fd0ed9c6bbcd61ac45419b5afae5ac..d512e87cfe361ceda0c4995b8e00ab7c3794a00a 100644 (file)
@@ -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;
                        }
 
index 5afa781f086861d088cb411641a55ab9de2acf48..05250eda472a13f11fd65479575e730de8e2427c 100644 (file)
@@ -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);
 
index 18797a8ee3d90a9948dc70a66e186e39d9e6f7ae..213a909aa921e847835c9532dacea4c00b5b2a34 100644 (file)
@@ -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);
index fa9fe9ffa26c6deda69fd5a7a71c4983bc9f826d..1574f0c68c1211eca1917403cd22f1f63c56ef06 100644 (file)
@@ -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);