I’m using the JDBC Sink Connector to stream data from Oracle to PostgreSQL.
In Oracle, both the table and column names are in UPPERCASE, whereas in PostgreSQL they are in LOWERCASE. As a result, the Kafka topics are created using UPPERCASE naming (e.g., main.ADMCMP). However, during insertion into PostgreSQL, I encounter the following error:
Error during write operation. Attempting rollback. (io.confluent.connect.jdbc.sink.JdbcDbWriter:89)
io.confluent.connect.jdbc.sink.TableAlterOrCreateException: Table “SMRT-PROD”.“main”.“ADMCMP” is missing and auto-creation is disabled.
Is there any built-in functionality or available “.jar” plugin that can help automatically handle this uppercase/lowercase mismatch between Kafka topics and PostgreSQL table/column names?
Below is the configuration I’m currently using for the JDBC Sink Connector:
name=postgresql-sink-connector
connector.class=io.confluent.connect.jdbc.JdbcSinkConnector
tasks.max=1
Topics (case-sensitive; assume uppercase in Kafka, lowercase in PostgreSQL)
topics=ADMCMP,ADMCMPPROF
PostgreSQL connection
connection.url=jdbc:postgresql://psql-erp-stage-01:5432/SMRT-PROD
connection.user=gslpgadmin
connection.password=gmpl
Disable automatic schema creation and evolution
auto.create=false
auto.evolve=false
Insert settings
insert.mode=INSERT
pk.mode=none
Ensure no quoting so lowercase PostgreSQL table/column names match
quote.sql.identifiers=ALWAYS
Map topic to schema.table
table.name.format=${topic}
transforms.ReplaceTopic.regex
Unwrap Debezium message (strip metadata)
transforms=unwrap
transforms.unwrap.type=io.debezium.transforms.ExtractNewRecordState
transforms.unwrap.drop.tombstones=true
transforms.unwrap.delete.handling.mode=drop
Converters
key.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=true
value.converter=org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable=true