在Trino中配置两个PostgreSQL数据库连接器仅显示一个的问题
解决Trino仅显示单个PostgreSQL数据库的问题
你当前的问题出在同一个catalog配置文件里重复定义了连接参数,Trino会忽略重复的配置项,只保留最后一组生效的参数,所以只能看到report数据库。
Trino的每个catalog对应一个独立的数据源(这里就是单个PostgreSQL数据库),正确的做法是为每个PostgreSQL数据库创建单独的catalog配置文件:
- 进入Trino的
catalog目录 - 创建第一个配置文件,比如命名为
postgres_db.properties,内容如下:connector.name=postgresql connection-url=jdbc:postgresql://localhost:5432/postgres connection-user=postgres connection-password=postgres case-insensitive-name-matching=true - 创建第二个配置文件,比如命名为
report_db.properties,内容如下:connector.name=postgresql connection-url=jdbc:postgresql://localhost:5432/report connection-user=postgres connection-password=postgres case-insensitive-name-matching=true - 重启Trino服务
完成后,你在Trino中就能看到两个新的catalog(postgres_db和report_db),分别对应你的两个PostgreSQL数据库。
内容的提问来源于stack exchange,提问作者Anahita barzegar
相关产品推荐
相关产品推荐

