Skip to content

Commit ea72701

Browse files
committed
Added support for PostgreSQL 18.
The function signature for ReplicationSlotAcquire changed and now requires a third parameter. There is also now a macro to get the tuple descriptor attribute.
1 parent 569a60b commit ea72701

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pg_squeeze.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,11 @@ setup_decoding(Oid relid, TupleDesc tup_desc, Snapshot *snap_hist)
991991
* Use the slot initialized by the scheduler worker (or by the backend
992992
* running the squeeze_table() function ).
993993
*/
994+
#if PG_VERSION_NUM >= 180000
995+
ReplicationSlotAcquire(NameStr(repl_slot->name), true, true);
996+
#else
994997
ReplicationSlotAcquire(NameStr(repl_slot->name), true);
998+
#endif
995999

9961000
/*
9971001
* This should not really happen, but if it did, the initial load could
@@ -2433,7 +2437,11 @@ has_dropped_attribute(Relation rel)
24332437

24342438
for (int i = 0; i < tup_desc->natts; i++)
24352439
{
2440+
#if PG_VERSION_NUM >= 180000
2441+
Form_pg_attribute attr = TupleDescAttr(tup_desc, i);
2442+
#else
24362443
Form_pg_attribute attr = &tup_desc->attrs[i];
2444+
#endif
24372445

24382446
if (attr->attisdropped)
24392447
return true;

0 commit comments

Comments
 (0)