liquibase 不支持"where not exists"以 postgres 作为数据库的子句吗?



在postgres数据库上插入行时,liquibase无法识别"不存在的地方"子句

insert into table (col1, col2) 
values (val1, val2)
WHERE NOT EXISTS (Select 1 from table where col1 = val1)/

错误信息:

运行 Liquibase 时出现意外错误:错误:在"WHERE"处或附近出现语法错误

没有液碱就可以正常工作。

不,语法是错误的。考虑使用 :

insert into "table" (col1, col2) 
select val1, val2 
from table0
where not exists ( select 1 from "table" where col1 = val1 )

其中table0是源,"table"是目标。

最新更新