postgresql - kafka-connect JDBC PostgreSQL Sink Connector 显式定义 PostgrSQL 模式(命名空间)
问题描述
我正在使用 JDBC 接收器连接器将数据写入 postgresql。
连接器工作正常,但似乎连接器只能将数据写入名为的默认 postgresql 模式public
这是 postgresql 的常见 JDBC URL 格式。
jdbc:postgresql://<host>:<port5432>/<database>
是否可以明确定义我需要 postgresql 接收器连接器写入的模式名称?
更新:
谢谢@Laurenz Albe 的提示。我可以search_path
在 jdbc 连接 URL 中定义,如下所示:
jdbc:postgresql://<host>:<port>/<database>?options=-c%20search_path=myschema,public
jdbc:postgresql://<host>:<port>/<database>?currentSchema=myschema
解决方案
使用options
连接参数设置search_path
:
jdbc:postgresql://<host>:<port5432>/<database>?options=-c%20search_path=myschema,public
推荐阅读
- android - Flutter - 如何在单击时切换 FlatButton 的颜色?
- r - r magick 高亮图片
- java - 如何在 jdk11 中重写一个静态的 final 字段?
- c# - 获取屏幕中心
- c# - .Net Core Docker 无法加载 DLL 'activeds.dll'
- google-apps-script - 延迟编辑功能以插入时间戳
- imagemagick - Imagemagick:将剪切区域应用于另一个图像
- performancecounter - 通过 Trace32 导出 BMC 跟踪流
- javascript - 从 JSON 列表中获取数据
- php - 在表格中整齐地显示与 ID 关联的记录