【问题标题】:The problem of openGauss database connection schemaopenGauss数据库连接schema问题
【发布时间】:2022-10-13 10:08:18
【问题描述】:

我们在将数据库从 oracle 迁移到 guassdb 时遇到了问题。它是与使用模式的 postgresdb 兼容的版本,

例如,select * from table1

现在因为 gauss 使用 schema,我们的表在 a01

查询变为select * from a01.table1,这会导致在迁移期间更改所有代码。每个表名前面都加了schema,太大了。有没有更好的解决方案,比如在url连接中加入schema,因为我们每个项目只使用一个schema

【问题讨论】:

    标签: open-gauss


    【解决方案1】:

    您可以在openGauss 数据库中配置用户的search_path。这个参数也可以通过jdbc中的url参数来配置。 例如:jdbc:postgresql://localhost:5432/mydatabase?currentSchema=a1

    【讨论】:

      猜你喜欢
      • 2022-07-19
      • 2022-08-15
      • 2020-04-06
      • 2022-07-19
      • 2016-07-12
      • 2012-02-29
      相关资源
      最近更新 更多