Update with returning as ifnull second expression

good day! I would like to clarify - is it possible to use (update … returning) construction as select ifnull(caseA, (update … returning xxx)) parameter ? I have lowest positive index for expression caseA, but if all elements of array for caseA are empty - null is returned for caseA and I would like to insert next autoincremented value from atomic counter, so for all operations no java client side is required

I’m not quite sure what you mean, but UPDATE is a statement, not an expression, and you usually cannot embed a statement inside an expression. Subexpressions are an exception to that, but they are always SELECT statements.