Skip to content

Commit

Permalink
Fix GetDatum changes for v16 and v17
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafia Sabih committed Dec 20, 2024
1 parent 8700161 commit 955bf91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pg_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,10 +974,10 @@ pg_mon(PG_FUNCTION_ARGS)
#if PG_VERSION_NUM < 160000
datums[idx++] = ObjectIdGetDatum(&entry->seq_scans[n]);
#else
datums[idx++] = ObjectIdGetDatum(entry->seq_scans[n]);
datums[idx++] = ObjectIdGetDatum(*(Oid *)&entry->seq_scans[n]);
#endif
}
arry = construct_array(datums, idx, OIDOID, sizeof(Oid), false, 'i');
arry = construct_array(datums, idx, OIDOID, sizeof(Oid), true, 'i');
values[i++] = PointerGetDatum(arry);
}
if (!entry->ModifyTable && entry->index_scans[0] == 0)
Expand All @@ -992,10 +992,10 @@ pg_mon(PG_FUNCTION_ARGS)
#if PG_VERSION_NUM < 160000
datums[idx++] = ObjectIdGetDatum(&entry->index_scans[n]);
#else
datums[idx++] = ObjectIdGetDatum(entry->index_scans[n]);
datums[idx++] = ObjectIdGetDatum(*(Oid *)&entry->index_scans[n]);
#endif
}
arry = construct_array(datums, idx, OIDOID, sizeof(Oid), false, 'i');
arry = construct_array(datums, idx, OIDOID, sizeof(Oid), true, 'i');
values[i++] = PointerGetDatum(arry);
}
if (!entry->ModifyTable && entry->bitmap_scans[0] == 0)
Expand All @@ -1010,10 +1010,10 @@ pg_mon(PG_FUNCTION_ARGS)
#if PG_VERSION_NUM < 160000
datums[idx++] = ObjectIdGetDatum(&entry->bitmap_scans[n]);
#else
datums[idx++] = ObjectIdGetDatum(entry->bitmap_scans[n]);
datums[idx++] = ObjectIdGetDatum(*(Oid *)&entry->bitmap_scans[n]);
#endif
}
arry = construct_array(datums, idx, OIDOID, sizeof(Oid), false, 'i');
arry = construct_array(datums, idx, OIDOID, sizeof(Oid), true, 'i');
values[i++] = PointerGetDatum(arry);
}
values[i++] = NameGetDatum(&entry->other_scan);
Expand Down

0 comments on commit 955bf91

Please sign in to comment.