pgsql: Doc: minor improvements for plpgsql "Transaction Management" sec

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Doc: minor improvements for plpgsql "Transaction Management" sec
Date: 2024-07-15 15:59:55
Message-ID: E1sTO7H-001lt5-KP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Doc: minor improvements for plpgsql "Transaction Management" section.

Point out that savepoint commands cannot be issued in PL/pgSQL,
and suggest that exception blocks can usually be used instead.

Add a caveat to the discussion of cursor loops vs. transactions,
pointing out that any locks taken by the cursor query will be lost
at COMMIT. This is implicit in what's already said, but the existing
text leaves the distinct impression that the auto-hold behavior is
transparent, which it's not really.

Per a couple of recent complaints (one unsigned, and one in bug #18531
from Dzmitry Jachnik). Back-patch to v17, just so this makes it into
current docs in less than a year-and-a-half.

Discussion: https://postgr.es/m/172076354433.736586.14347210271966220018@wrigleys.postgresql.org
Discussion: https://postgr.es/m/18531-c6dddd33b8555fd2@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a0899c0a97d19b0c330ff885af4b78b3e7efb100

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2024-07-15 16:40:55 pgsql: Fix type confusion in guc_var_compare()
Previous Message Thomas Munro 2024-07-15 09:50:51 pgsql: Run LLVM verify pass on IR in assert builds.