Skip to content

Regression in JdbcSinkConnector 10.7.7+: PostgreSQL Cross-Database Reference Error Due to Catalog Injection #1528

@Adiloninho

Description

@Adiloninho

We were using Confluent Platform 7.3.x with JdbcSinkConnector 10.6.1 to insert data from Kafka into a PostgreSQL table. Everything worked perfectly.

After upgrading to Confluent Platform 7.9.x and JdbcSinkConnector 10.8.2, the connector stopped working and started raising the following exception:

Caused by: java.sql.SQLException: Exception chain:
java.sql.BatchUpdateException: Batch entry 0 INSERT INTO DatabaseName.SchemaName.TableName (TX_META_A,TX_META_B,TX_META_C,TX_META_D,TX_META_E) VALUES (('XXXXXX'),('XXXXXX'),('XX'),('XXXX'),('XXXXXX')) was aborted: ERROR: cross-database references are not implemented: DatabaseName.SchemaName.TableName
Position: 13 Call getNextException to see other errors in the batch.

Our connector configuration uses:
table.name.format": "SchemaName.TableName"

However, the connector appears to append the database name (catalog), resulting in SQL like:
INSERT INTO DatabaseName.SchemaName.TableName ...

Regression Details:
✅ Working: 10.6.1, 10.6.6, 10.7.0, 10.7.6
❌ Failing: 10.7.7, 10.7.11, 10.7.15, 10.8.2, 10.8.4
The regression was introduced in JdbcDbWriter.java starting from version 10.7.7, where the connector began injecting the catalog name (retrieved from the JDBC connection) into the TableId used for SQL generation.
It seems like it was introduced by this commit : 57bc7e2

Suggested Fix:
Revert to the behavior from 10.7.6 for PostgreSQL dialects
Or introduce a config such as "use.catalog.name" ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions