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

Postgres delete operations throwing DataException

XMLWordPrintable

    • Hide
      1. Ensure Debezium is connected
      2. CREATE TABLE test (
        id character varying(255) NOT NULL PRIMARY KEY,
        time_with_zone timestamp with time zone NOT NULL
        );
      3. INSERT INTO test VALUES ('id', now());
      4. DELETE FROM test;

      The delete causes an exception to be thrown in Debezium/Kafka Connect.

      Show
      Ensure Debezium is connected CREATE TABLE test ( id character varying(255) NOT NULL PRIMARY KEY, time_with_zone timestamp with time zone NOT NULL ); INSERT INTO test VALUES ('id', now()); DELETE FROM test; The delete causes an exception to be thrown in Debezium/Kafka Connect.

      Not sure whether this is a Debezium bug or Kafka Connect for Postgres, but here's the exception I get in ConnectSchema.java:219:

      public static void validateValue(String name, Schema schema, Object value) {
              if (value == null) {
                  if (!schema.isOptional())
                      throw new DataException("Invalid value: null used for required field: \"" + name
                              + "\", schema type: " + schema.type());
                  return;
              }
      

      If the "with time zone" clause is dropped from the DDL it works fine. I think I have the default replica identity, so it's expected that I won't have non-PK columns for the delete (this is while constructing the "before" side of the operation).

              Unassigned Unassigned
              keith@onthebarrelhead.com Keith Barber (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: