简体   繁体   中英

kafka-connect JDBC PostgreSQL Sink Connector explicitly define the PostgrSQL schema (namespace)

I am using the JDBC sink connector to write data to postgresql.

The connector works fine, but it seems the connector can only write data to the default postgresql schema called public

This is the common JDBC URL format for postgresql.

jdbc:postgresql://<host>:<port5432>/<database>

Is it possible to explicitly define the schema name, to which I need the postgresql sink connector to write?

UPDATE :

Thanks, @Laurenz Albe for the hint. I can define search_path in the jdbc connection URL like either of these:

jdbc:postgresql://<host>:<port>/<database>?options=-c%20search_path=myschema,public

jdbc:postgresql://<host>:<port>/<database>?currentSchema=myschema

Use the options connection parameter to set the search_path :

jdbc:postgresql://<host>:<port5432>/<database>?options=-c%20search_path=myschema,public

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM