• Peter Eisentraut's avatar
    Allow committing inside cursor loop · 056a5a3f
    Peter Eisentraut authored
    Previously, committing or aborting inside a cursor loop was prohibited
    because that would close and remove the cursor.  To allow that,
    automatically convert such cursors to holdable cursors so they survive
    commits or rollbacks.  Portals now have a new state "auto-held", which
    means they have been converted automatically from pinned.  An auto-held
    portal is kept on transaction commit or rollback, but is still removed
    when returning to the main loop on error.
    
    This supports all languages that have cursor loop constructs: PL/pgSQL,
    PL/Python, PL/Perl.
    Reviewed-by: default avatarIldus Kurbangaliev <i.kurbangaliev@postgrespro.ru>
    056a5a3f
plpy_plpymodule.c 14.9 KB