我正在尝试使用liquibase在Postgres中创建SP并传递schemaName,但它始终在公共模式下创建SP。我的更改集看起来像
> <createProcedure relativeToChangelogFile="true"
> dbms="postgresql"
> path="storeProcedures/cirrus_UTC_Timestamp.sql"
> schemaName="cirrusdb"
> procedureName="cirrus_UTC_Timestamp">
> </createProcedure>
从Liquibase命令调试日志
C:/views/P4V/cirrus_dev/cirrus/main/build/package/src/main/resources/scripts/MasterDBChangeLogs.xml:
C:/views/P4V/cirrus_dev/cirrus/main/build/package/src/main/resources/scripts/MasterDBChangeLogs.xml::8.2.0.0-1::guptaa8:
Computed checksum for create Procedure:[
dbms="postgresql"
path="storeProcedures/cirrus_UTC_Timestamp.sql"
procedureName="cirrus_UTC_Timestamp"
relativeToChangelogFile="true"
schemaName="cirrusdb" ] as 75cfb2062231cfb7a0813a82a4f62764 DEBUG 11/18/15 2:38 PM: liquibase:
C:/views/P4V/cirrus_dev/cirrus/main/build/package/src/main/resources/scripts/MasterDBChangeLogs.xml:
C:/views/P4V/cirrus_dev/cirrus/main/build/package/src/main/resources/scripts/MasterDBChangeLogs.xml::8.2.0.0-1::guptaa8:
Computed checksum for 7:75cf
b2062231cfb7a0813a82a4f62764:7:0a8a327c03ced9a7b29acb65fee085b9 as
0591c7cae23e75e7ea48680d9e7fb742 DEBUG 11/18/15 2:38 PM: liquibase:
C:/views/P4V/cirrus_dev/cirrus/main/build/package/src/main/resources/scripts/MasterDBChangeLogs.xml:
C:/views/P4V/cirrus_dev/cirrus/main/build/package/src/main/resources/scripts/MasterDBChangeLogs.xml::8.2.0.0-1::guptaa8:
Computed checksum for 7:0591 c7cae23e75e7ea48680d9e7fb742: as
ae8a55a46214d182fab4b59f8765b90d DEBUG 11/18/15 2:38 PM: liquibase:
Release Database Lock DEBUG 11/18/15 2:38 PM: liquibase: Executing
UPDATE database command: UPDATE cirrusdb.databasechangeloglock SET
LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO
11/18/15 2:38 PM: liquibase: Successfully released change log lock
Liquibase Update Successful
Liquibase版本:3.4.1,Postgres版本9.3
答案 0 :(得分:0)
经过一些研究后,我发现liquibase(最高3.4.2)不支持createProcedure标签上的schemaName,仅支持'informational':
来源:https://liquibase.jira.com/browse/CORE-2626
门票说明:
目前不使用createProcedure schemaName,它只是用于 信息目的。如果schemaName是,则更改createProcedure 指定后,它将使用SqlParser类来查找名称 正文中的过程,可以在模式之前添加或替换 具有给定schemaName的现有模式。添加一个新的 liquibase.useProcedureSchema = true | false flag如果为false则不会 进行解析但是添加ALTER SESSION USE DEFAULT SCHEMA ... 创建过程SQL之前和之后的语句。