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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rashid Abzalov <rashid(dot)abzalov(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
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: 2019-07-12 20:33:10
Message-ID: 5894.1562963590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Manuel Rigger 2019-07-12 23:18:53 Re: ERROR: found unexpected null value in index
Previous Message Tom Lane 2019-07-12 20:28:12 Re: ERROR: found unexpected null value in index