Skip to content

Commit 30dc5ad

Browse files
committed
Fix PostgreSQL 17 compilation
When compiling against PG17 on Debian testing with gcc 14, building fails because of incompatible-pointer-type error. This commit updates the macros added in e1f8714 to handle the pointer types.
1 parent e1f8714 commit 30dc5ad

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/decoderbufs.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
#endif
6262

6363
#if PG_VERSION_NUM >= 170000
64-
#define TUPLE_ACCESS
64+
#define TUPLE_ACCESS(x) x
6565
#else
66-
#define TUPLE_ACCESS ->tuple
66+
#define TUPLE_ACCESS(x) &x->tuple
6767
#endif
6868

6969
PG_MODULE_MAGIC;
@@ -628,13 +628,13 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
628628
rmsg.new_tuple =
629629
palloc(sizeof(Decoderbufs__DatumMessage*) * rmsg.n_new_tuple);
630630
tuple_to_tuple_msg(rmsg.new_tuple, relation,
631-
&change->data.tp.newtuple TUPLE_ACCESS, tupdesc);
631+
TUPLE_ACCESS(change->data.tp.newtuple), tupdesc);
632632

633633
rmsg.n_new_typeinfo = rmsg.n_new_tuple;
634634
rmsg.new_typeinfo =
635635
palloc(sizeof(Decoderbufs__TypeInfo*) * rmsg.n_new_typeinfo);
636636
add_metadata_to_msg(rmsg.new_typeinfo, relation,
637-
&change->data.tp.newtuple TUPLE_ACCESS, tupdesc);
637+
TUPLE_ACCESS(change->data.tp.newtuple), tupdesc);
638638
}
639639
break;
640640
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -649,7 +649,7 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
649649
rmsg.old_tuple =
650650
palloc(sizeof(Decoderbufs__DatumMessage*) * rmsg.n_old_tuple);
651651
tuple_to_tuple_msg(rmsg.old_tuple, relation,
652-
&change->data.tp.oldtuple TUPLE_ACCESS, tupdesc);
652+
TUPLE_ACCESS(change->data.tp.oldtuple), tupdesc);
653653
}
654654
if (change->data.tp.newtuple != NULL) {
655655
elog(DEBUG1, "decoding new tuple information");
@@ -659,13 +659,13 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
659659
rmsg.new_tuple =
660660
palloc(sizeof(Decoderbufs__DatumMessage*) * rmsg.n_new_tuple);
661661
tuple_to_tuple_msg(rmsg.new_tuple, relation,
662-
&change->data.tp.newtuple TUPLE_ACCESS, tupdesc);
662+
TUPLE_ACCESS(change->data.tp.newtuple), tupdesc);
663663

664664
rmsg.n_new_typeinfo = rmsg.n_new_tuple;
665665
rmsg.new_typeinfo =
666666
palloc(sizeof(Decoderbufs__TypeInfo*) * rmsg.n_new_typeinfo);
667667
add_metadata_to_msg(rmsg.new_typeinfo, relation,
668-
&change->data.tp.newtuple TUPLE_ACCESS, tupdesc);
668+
TUPLE_ACCESS(change->data.tp.newtuple), tupdesc);
669669
}
670670
}
671671
break;
@@ -681,7 +681,7 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
681681
rmsg.old_tuple =
682682
palloc(sizeof(Decoderbufs__DatumMessage*) * rmsg.n_old_tuple);
683683
tuple_to_tuple_msg(rmsg.old_tuple, relation,
684-
&change->data.tp.oldtuple TUPLE_ACCESS, tupdesc);
684+
TUPLE_ACCESS(change->data.tp.oldtuple), tupdesc);
685685
} else {
686686
elog(DEBUG1, "no information to decode from DELETE because either no PK is present or REPLICA IDENTITY NOTHING or invalid ");
687687
}

0 commit comments

Comments
 (0)