@@ -500,7 +500,11 @@ static void pg_decode_begin_txn(LogicalDecodingContext *ctx,
500
500
rmsg .has_op = true;
501
501
rmsg .transaction_id = txn -> xid ;
502
502
rmsg .has_transaction_id = true;
503
+ #if PG_VERSION_NUM >= 150000
504
+ rmsg .commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH (txn -> xact_time .commit_time );
505
+ #else
503
506
rmsg .commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH (txn -> commit_time );
507
+ #endif
504
508
rmsg .has_commit_time = true;
505
509
506
510
/* write msg */
@@ -538,7 +542,11 @@ static void pg_decode_commit_txn(LogicalDecodingContext *ctx,
538
542
rmsg .has_op = true;
539
543
rmsg .transaction_id = txn -> xid ;
540
544
rmsg .has_transaction_id = true;
545
+ #if PG_VERSION_NUM >= 150000
546
+ rmsg .commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH (txn -> xact_time .commit_time );
547
+ #else
541
548
rmsg .commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH (txn -> commit_time );
549
+ #endif
542
550
rmsg .has_commit_time = true;
543
551
544
552
/* write msg */
@@ -590,7 +598,11 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
590
598
/* set common fields */
591
599
rmsg .transaction_id = txn -> xid ;
592
600
rmsg .has_transaction_id = true;
601
+ #if PG_VERSION_NUM >= 150000
602
+ rmsg .commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH (txn -> xact_time .commit_time );
603
+ #else
593
604
rmsg .commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH (txn -> commit_time );
605
+ #endif
594
606
rmsg .has_commit_time = true;
595
607
rmsg .table = pstrdup (quote_qualified_identifier (get_namespace_name (get_rel_namespace (RelationGetRelid (relation ))),
596
608
NameStr (class_form -> relname )));
0 commit comments