jjzjj

java - Liquibase 错误 [Postgresql] : unterminated dollar-quoted string at or near "$BODY$

coder 2024-03-11 原文

Liquibase error: unterminated dollar-quoted string at or near "$BODY$`

Chaneg 日志 xml 有一个条目:见下文 包含文件="/home/dev/....../admin_script.sql"

文件内容:

...............
CREATE OR REPLACE FUNCTION my_schema.function-name()
RETURNS smallint AS
$BODY$
   DECLARE
      v_next_gen_id smallint := 0;
   BEGIN
..........

异常(exception):

liquibase.exception.DatabaseException: Error executing SQL CREATE OR REPLACE FUNCTION function name()
ETURNS smallint AS
$BODY$
   DECLARE
      v_next_gen_id smallint := 0: ERROR: unterminated dollar-quoted string at or near "$BODY$

感谢解决此问题的任何帮助

最佳答案

我几天前刚遇到同样的问题。

如果我们使用以下格式将变更集添加到 changelog.xml 文件中,则不起作用:
<include file="path/to/sqlfile" />

为了变通,我使用了另一种格式:

<changeSet author="authour_name" id="your_id">
    <sqlFile path="path/to/sqlfile" splitStatements="false"/>
</changeSet>

这是对 Problem with dollar-quoted-in-postgresql 进行简要说明的链接。 .

关于java - Liquibase 错误 [Postgresql] : unterminated dollar-quoted string at or near "$BODY$,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35734806/

有关java - Liquibase 错误 [Postgresql] : unterminated dollar-quoted string at or near "$BODY$的更多相关文章

随机推荐