Rashid Abzalov <rashid(dot)abzalov(at)gmail(dot)com> writes:
> The statement is re-executed on commit if it is declared as "cursor with
> hold" and the cursor is not closed yet.
That is not a bug, it's how cursors with hold work.
(Volatile functions in cursors are a pretty fraught issue all around.
I do not think we make very many guarantees about how often they'll
be executed, if you do any re-reading or re-positioning of the cursor.)
regards, tom lane