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

Add a Merge Into insert mode to handle PK changes in jdbc sink

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • Backlog
    • None
    • jdbc-connector
    • None
    • False
    • None
    • False

      Even with the upsert insert mode with Postgres, when a PK changes, we end with two lines in the database.

      Instead of using INSERT INTO ON CONFLICT, we can use MERGE INTO which is fully supported in recent PG Versions.

      Requirement to use MERGE INTO

      • Recent PG version
      • Old the fields used in the key must be present in the record value to extract the old key from the before field
      • Not compatible with flat records

      Work in progress in this branch: https://github.com/debezium/debezium-connector-jdbc/compare/main...bpaquet:debezium-connector-jdbc:merge_into

              Unassigned Unassigned
              bertrand.paquet@gmail.com Bertrand Paquet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: