committing inside cursor loop

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: committing inside cursor loop
Date: 2018-02-20 14:11:50
Message-ID: fc2707cd-8fd5-2f8c-8c25-316778a2ac70@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch that allows COMMIT inside cursor loops in PL/pgSQL. As
alluded to in earlier threads, this is done by converting such cursors
to holdable automatically. A special flag "auto-held" marks such
cursors, so we know to clean them up on exceptions.

This is currently only for PL/pgSQL, but the same technique could be
applied easily to other PLs.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v1-0001-PL-pgSQL-Allow-committing-inside-cursor-loop.patch text/plain 10.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2018-02-20 14:18:20 Re: [bug fix] Produce a crash dump before main() on Windows
Previous Message Magnus Hagander 2018-02-20 13:47:25 Re: [bug fix] Produce a crash dump before main() on Windows