Re: The statement is re-executed (performed twice) on commit if it is declared as "cursor with hold" and the cursor is not closed yet - Mailing list pgsql-bugs

From Tom Lane
Subject Re: The statement is re-executed (performed twice) on commit if it is declared as "cursor with hold" and the cursor is not closed yet
Date
Msg-id 5894.1562963590@sss.pgh.pa.us
Whole thread Raw
In response to The statement is re-executed (performed twice) on commit if it isdeclared as "cursor with hold" and the cursor is not closed yet  (Rashid Abzalov <rashid.abzalov@gmail.com>)
Responses Re: The statement is re-executed (performed twice) on commit if it isdeclared as "cursor with hold" and the cursor is not closed yet  (Rashid Abzalov <rashid.abzalov@gmail.com>)
List pgsql-bugs
Rashid Abzalov <rashid.abzalov@gmail.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



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: found unexpected null value in index
Next
From: Manuel Rigger
Date:
Subject: Re: ERROR: found unexpected null value in index