Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1801ced

Browse files
committed
origin info in commit messages
1 parent9189353 commit1801ced

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

‎contrib/test_decoding/sql/prepared.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ DROP TABLE test_prepared2;
4848
SELECT dataFROM pg_logical_slot_peek_changes('regression_slot',NULL,NULL,'include-xids','0','skip-empty-xacts','1');
4949

5050
-- same but with twophase decoding
51-
SELECT dataFROM pg_logical_slot_peek_changes('regression_slot',NULL,NULL,'include-xids','0','skip-empty-xacts','1','twophase-decoding','1');
51+
SELECT dataFROM pg_logical_slot_peek_changes('regression_slot',NULL,NULL,'include-xids','0','skip-empty-xacts','1','twophase-decoding','1');
5252

5353
SELECT pg_drop_replication_slot('regression_slot');

‎src/backend/replication/logical/decode.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,12 @@ DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
651651
inti;
652652
TransactionIdxid=parsed->twophase_xid;
653653

654+
if (parsed->xinfo&XACT_XINFO_HAS_ORIGIN)
655+
{
656+
origin_lsn=parsed->origin_lsn;
657+
commit_time=parsed->origin_timestamp;
658+
}
659+
654660
/*
655661
* Process invalidation messages, even if we're not interested in the
656662
* transaction's contents, since the various caches need to always be
@@ -703,9 +709,15 @@ DecodeAbort(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
703709
{
704710
inti;
705711
XLogRecPtrorigin_lsn=InvalidXLogRecPtr;
706-
XLogRecPtrcommit_time=InvalidXLogRecPtr;
712+
TimestampTzcommit_time=0;
707713
XLogRecPtrorigin_id=XLogRecGetOrigin(buf->record);
708714

715+
if (parsed->xinfo&XACT_XINFO_HAS_ORIGIN)
716+
{
717+
origin_lsn=parsed->origin_lsn;
718+
commit_time=parsed->origin_timestamp;
719+
}
720+
709721
/*
710722
* If that is ROLLBACK PREPARED than send that to callbacks.
711723
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp