mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Modify UPDATE/DELETE WHERE CURRENT OF to use the FOR UPDATE infrastructure to
locate the target row, if the cursor was declared with FOR UPDATE or FOR SHARE. This approach is more flexible and reliable than digging through the plan tree; for instance it can cope with join cursors. But we still provide the old code for use with non-FOR-UPDATE cursors. Per gripe from Robert Haas.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.135 2008/10/28 22:02:05 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.136 2008/11/16 17:34:28 tgl Exp $ -->
|
||||
|
||||
<chapter id="plpgsql">
|
||||
<title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title>
|
||||
@@ -2674,9 +2674,10 @@ DELETE FROM <replaceable>table</replaceable> WHERE CURRENT OF <replaceable>curso
|
||||
|
||||
<para>
|
||||
When a cursor is positioned on a table row, that row can be updated
|
||||
or deleted using the cursor to identify the row. Note that this
|
||||
only works for simple (non-join, non-grouping) cursor queries.
|
||||
For additional information see the
|
||||
or deleted using the cursor to identify the row. There are
|
||||
restrictions on what the cursor's query can be (in particular,
|
||||
no grouping) and it's best to use <literal>FOR UPDATE</> in the
|
||||
cursor. For additional information see the
|
||||
<xref linkend="sql-declare" endterm="sql-declare-title">
|
||||
reference page.
|
||||
</para>
|
||||
|
||||
Reference in New Issue
Block a user