Skip to content

Commit

Permalink
Support PostgreSQL 16. Update win PG versions in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
arkhipov committed Sep 24, 2023
1 parent 90ce0bf commit 0935a06
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- 13
- 14
- 15
- 16

steps:
- uses: actions/checkout@v3
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
- 9.5.25-1
- 9.6.24-1
- 10.23-1
- 11.19-1
- 12.14-1
- 13.10-1
- 14.7-1
- 15.2-1
- 11.21-1
- 12.16-1
- 13.12-1
- 14.9-1
- 15.4-1
- 16.0-1
platform:
- x64
include:
Expand Down
20 changes: 20 additions & 0 deletions versioning.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,11 @@ insert_history_row(HeapTuple tuple,
int natts;

/* Open the history relation and obtain AccessShareLock on it. */
#if PG_VERSION_NUM >= 160000
relrv = makeRangeVarFromNameList(stringToQualifiedNameList(history_relation_name, NULL));
#else
relrv = makeRangeVarFromNameList(stringToQualifiedNameList(history_relation_name));
#endif

history_relation = heap_openrv(relrv, AccessShareLock);

Expand Down Expand Up @@ -927,7 +931,11 @@ versioning_insert(TriggerData *trigdata,
upper.inclusive = false;
upper.lower = false;

#if PG_VERSION_NUM >= 160000
range = make_range(typcache, &lower, &upper, false, NULL);
#else
range = make_range(typcache, &lower, &upper, false);
#endif

return PointerGetDatum(modify_tuple(trigdata->tg_relation, trigdata->tg_trigtuple, period_attnum, range));
}
Expand Down Expand Up @@ -978,7 +986,11 @@ versioning_update(TriggerData *trigdata,
/* Adjust if needed. */
adjust_system_period(typcache, &lower, &upper, adjust_argument, relation);

#if PG_VERSION_NUM >= 160000
range = make_range(typcache, &lower, &upper, false, NULL);
#else
range = make_range(typcache, &lower, &upper, false);
#endif

history_tuple = modify_tuple(relation, tuple, period_attnum, range);

Expand All @@ -993,7 +1005,11 @@ versioning_update(TriggerData *trigdata,
upper.infinite = true;
upper.inclusive = false;

#if PG_VERSION_NUM >= 160000
range = make_range(typcache, &lower, &upper, false, NULL);
#else
range = make_range(typcache, &lower, &upper, false);
#endif

return PointerGetDatum(modify_tuple(relation, trigdata->tg_newtuple, period_attnum, range));
}
Expand Down Expand Up @@ -1040,7 +1056,11 @@ versioning_delete(TriggerData *trigdata,
/* Adjust if needed. */
adjust_system_period(typcache, &lower, &upper, adjust_argument, relation);

#if PG_VERSION_NUM >= 160000
range = make_range(typcache, &lower, &upper, false, NULL);
#else
range = make_range(typcache, &lower, &upper, false);
#endif

history_tuple = modify_tuple(relation, tuple, period_attnum, range);

Expand Down

0 comments on commit 0935a06

Please sign in to comment.