I have a problem with liquibase and PostgreSQL JSONB arrow functions. When I trying to use such functions in liquibase changesets, for example:
CREATE UNIQUE INDEX foo_index ON public.foo (bar ->> 'bar');
I get some:
liquibase.exception.DatabaseException: ERROR: syntax error at or near "->>"
as a result during compilation. Maybe anybody knows how can such behavior be avoided. (Ignore syntax check or rewrite statement maybe).
CREATE UNIQUE INDEX foo_index ON public.foo (bar ->> 'bar');
Expressions need to wrapped in an extra layer of parentheses.
CREATE UNIQUE INDEX foo_index ON public.foo ((bar ->> 'bar'));
This is purely a PostgreSQL syntax issue, I think liquibase has nothing to do with it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.