pgsql-bugs(at)postgresql(dot)org writes:
> Sometimes when running concurrent updates, the function fails with ERROR: More than one tuple returned by a subselect used as an expression.
Can't say much about this when you aren't showing us the
concurrent-update sequence of operations.
regards, tom lane