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

postgresql-connector does not detect column type changes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 0.6.2
    • postgresql-connector
    • None
    • Hide
      1. Create test table and fill it with initial data:
      • create table test(a int primary key, b varchar);
      • insert into test(a, b) VALUES (1, 'a');
        --> changes were streamed correctly with column "b" type: "string"
      1. Change column type and update rows:
      • alter table test drop column b;
      • alter table test add column b date;
      • update test set b = current_date;
        --> changes were streamed incorrectly with column "b" type: "string" (should be "date")
      Show
      Create test table and fill it with initial data: create table test(a int primary key, b varchar); insert into test(a, b) VALUES (1, 'a'); --> changes were streamed correctly with column "b" type: "string" Change column type and update rows: alter table test drop column b; alter table test add column b date; update test set b = current_date; --> changes were streamed incorrectly with column "b" type: "string" (should be "date")

      After changing column type in database and updating that column, all the changes are streamed with old column type.

      I think that I have localized this bug in method schemaChanged from src/main/java/io/debezium/connector/postgresql/RecordsStreamProducer.java:
      it is line of code with "!schema().isType(column.typeName(), column.jdbcType())".
      I think that we should compare message.getType() and column.typeName() there.

      I have no ability to create pull request with fix because I have no experience in Java and have no dev environment for it.
      It would be great if someone can help with this little bug(It is just a one-liner fix)

              Unassigned Unassigned
              6opuc_jira Boris Nadezhdin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: