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

Postgres delete operations throwing DataException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 0.9.1.Final
    • Fix Version/s: 0.9.2.Final
    • Component/s: postgresql-connector
    • Labels:
      None
    • Environment:

      debezium/postgres:10 with wal2json
      JDK10
      Maven
      Kubuntu 18.04

    • Steps to Reproduce:
      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.

      Description

      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).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  kbarber2 Keith Barber
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: