-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
It is not possible to compile postgres-decodebufs against PostgreSQL 15 now:
src/decoderbufs.c:503:59: error: no member named 'commit_time' in 'struct ReorderBufferTXN' rmsg.commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(txn->commit_time); ~~~ ^ src/decoderbufs.c:69:47: note: expanded from macro 'TIMESTAMPTZ_TO_USEC_SINCE_EPOCH' #define TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(t) t + (POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY; ^ src/decoderbufs.c:541:59: error: no member named 'commit_time' in 'struct ReorderBufferTXN' rmsg.commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(txn->commit_time); ~~~ ^ src/decoderbufs.c:69:47: note: expanded from macro 'TIMESTAMPTZ_TO_USEC_SINCE_EPOCH' #define TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(t) t + (POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY; ^ src/decoderbufs.c:593:59: error: no member named 'commit_time' in 'struct ReorderBufferTXN' rmsg.commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(txn->commit_time); ~~~ ^ src/decoderbufs.c:69:47: note: expanded from macro 'TIMESTAMPTZ_TO_USEC_SINCE_EPOCH' #define TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(t) t + (POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY; ^ 3 errors generated. make: *** [src/decoderbufs.o] Error 1
because of the following changes made into pg15:
--- a/src/include/replication/reorderbuffer.h +++ b/src/include/replication/reorderbuffer.h @@ -297,7 +297,11 @@ typedef struct ReorderBufferTXN * Commit or Prepare time, only known when we read the actual commit or * prepare record. */ - TimestampTz commit_time; + union + { + TimestampTz commit_time; + TimestampTz prepare_time; + } xact_time;
(commit https://github.com/postgres/postgres/commit/a8fd13cab0ba815e9925dc9676e6309f699b5f72)
This PR tries to solve the problem and ensure PG15 compatibility