Liquibase错误[Postgresql]:未结算的美元引用字符串或者附近“$ BODY $ [英] Liquibase error [Postgresql]: unterminated dollar-quoted string at or near "$BODY$

查看:162
本文介绍了Liquibase错误[Postgresql]:未结算的美元引用字符串或者附近“$ BODY $的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Liquibase错误:未终止的美元引用字符串在或接近$ BODY $`

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

Chaneg log xml有一个条目:见下面
include file =/ home / dev /....../ admin_script.sql

Chaneg log xml has one entry: see below include file="/home/dev/....../admin_script.sql"

的内容file:

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

异常:


liquibase.exception.DatabaseException:执行SQL时出错CREATE OR REPLACE FUNCTION函数名称()
ETURNS smallint AS
$ BODY $
DECLARE
v_next_gen_id smallint: = 0:错误:未终止的美元引用字符串为$ BODY $

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$

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

Appreciate any help to resolve this

推荐答案

我刚刚遇到同样的问题走。

I just encountered the same issue days ago.

如果我们使用以下格式将变更集添加到changelog.xml文件中,它不起作用:

< include file =path / to / sqlfile/>

It does not work if we add the changeset into changelog.xml file using the format below:
<include file="path/to/sqlfile" />

要解决此问题,我使用其他格式:

To work around, I use another format:

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

以下链接简要解释了美元引用的postgresql问题

Here is the link which gives a brief explanation to Problem with dollar-quoted-in-postgresql.

这篇关于Liquibase错误[Postgresql]:未结算的美元引用字符串或者附近“$ BODY $的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆