Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5370

Support for Postgres 15

    XMLWordPrintable

Details

    Description

      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

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hughcapet Polina Bungina (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: