Skip to content

Commit 8cd1caa

Browse files
author
Antonin Houska
committed
More updates to support PostgreSQL 18.
ea72701 fixed the compatibility, but the core API changed since.
1 parent 9958e05 commit 8cd1caa

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

concurrent.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,13 @@ apply_concurrent_changes(DecodingOutputState *dstate, Relation relation,
366366
* the reason to increment the counter). However, heap_update()
367367
* does require CommandCounterIncrement().
368368
*/
369+
#if PG_VERSION_NUM >= 180000
370+
scan = index_beginscan(relation, iistate->ident_index,
371+
GetActiveSnapshot(), NULL, nkeys, 0);
372+
#else
369373
scan = index_beginscan(relation, iistate->ident_index,
370374
GetActiveSnapshot(), nkeys, 0);
375+
#endif
371376

372377
index_rescan(scan, key, nkeys, NULL, 0);
373378

pg_squeeze.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ int squeeze_max_xlock_time = 0;
158158
* way to pass list of database name w/o adding restrictions on character set
159159
* characters.)
160160
*/
161-
char *squeeze_worker_autostart = NULL;
161+
static char *squeeze_worker_autostart = NULL;
162162

163163
/*
164164
* Role on behalf of which automatically-started worker connects to
165165
* database(s).
166166
*/
167-
char *squeeze_worker_role = NULL;
167+
static char *squeeze_worker_role = NULL;
168168

169169
/* The number of squeeze workers per database. */
170170
int squeeze_workers_per_database = 1;
@@ -2058,7 +2058,12 @@ perform_initial_load(Relation rel_src, RangeVar *cluster_idx_rv,
20582058
heap_scan = table_beginscan(rel_src, snap_hist, 0, (ScanKey) NULL);
20592059
else
20602060
{
2061+
#if PG_VERSION_NUM >= 180000
2062+
index_scan = index_beginscan(rel_src, cluster_idx, snap_hist, NULL, 0,
2063+
0);
2064+
#else
20612065
index_scan = index_beginscan(rel_src, cluster_idx, snap_hist, 0, 0);
2066+
#endif
20622067
index_rescan(index_scan, NULL, 0, NULL, 0);
20632068
}
20642069

0 commit comments

Comments
 (0)