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

Support PostgreSQL coercion for UUID, JSON, and JSONB data types

XMLWordPrintable

      When handling data replication across database vendor boundaries, such as a database that does not support UUIDs to a database like PostgreSQL that supports UUID values, the source event may be represented by Schema.Type.STRING, as shown here:

      2023-06-20 18:13:05,507 TRACE  ||  Schema type 'STRING' resolved by name from registry to type 'ConnectStringType'   [io.debezium.connector.jdbc.dialect.GeneralDatabaseDialect]
      2023-06-20 18:13:05,508 TRACE  ||  Field [id] with schema [STRING]   [io.debezium.connector.jdbc.SinkRecordDescriptor$FieldDescriptor]
      2023-06-20 18:13:05,508 TRACE  ||      Type      : io.debezium.connector.jdbc.type.connect.ConnectStringType   [io.debezium.connector.jdbc.SinkRecordDescriptor$FieldDescriptor]
      2023-06-20 18:13:05,508 TRACE  ||      Optional  : true   [io.debezium.connector.jdbc.SinkRecordDescriptor$FieldDescriptor]
      

      Normally, the PostgreSQL connector would only treat this value as a UUID if the incoming field's schema type was io.debezium.data.Uuid; however, we should also support the concept that if the destination field is UUID that we attempt the coercion in the built SQL using:

      '<the uuid string value>'::uuid
      

            ccranfor@redhat.com Chris Cranford
            ccranfor@redhat.com Chris Cranford
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: