diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/json/PostgreSQLJsonArrayAppendFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/json/PostgreSQLJsonArrayAppendFunction.java index a37038fe69..7448e42ec4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/json/PostgreSQLJsonArrayAppendFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/json/PostgreSQLJsonArrayAppendFunction.java @@ -42,7 +42,7 @@ public class PostgreSQLJsonArrayAppendFunction extends AbstractJsonArrayAppendFu sqlAppender.appendSql( "jsonb_set_lax" ); } else { - sqlAppender.appendSql( "case when t.d#>t.p is not null then jsonb_set" ); + sqlAppender.appendSql( "case when (t.d)#>t.p is not null then jsonb_set" ); } sqlAppender.appendSql( "(t.d,t.p,(t.d)#>t.p||" ); if ( value instanceof Literal && ( (Literal) value ).getLiteralValue() == null ) {