From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-docs <pgsql-docs@postgresql.org>
Subject: Re: updatable cursors and ORDER BY
Date: Mon, 11 Jun 2018 20:44:14 -0400
Message-ID: <b0af1f4a-b39f-5a18-fcd2-b4f2a4a0303e@2ndquadrant.com> (raw)
In-Reply-To: <20180528171716.GA5306@momjian.us>
References: <fa0e80d3-a734-4db1-cf66-fe6d3a6c043b@2ndquadrant.com>
<2966.1525921045@sss.pgh.pa.us>
<8dc63ba7-dc56-fc7c-fc16-4fae03e3bfe6@2ndquadrant.com>
<22649.1525971323@sss.pgh.pa.us>
<20180528171716.GA5306@momjian.us>
On 5/28/18 13:17, Bruce Momjian wrote:
> On Thu, May 10, 2018 at 12:55:23PM -0400, Tom Lane wrote:
>> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>>> I think that last part isn't actually written down anywhere. (It only
>>> states the converse.) How about a clarification like this:
>>
>>> @@ -271,7 +271,10 @@ <title id="sql-declare-notes-title">Notes</title>
>>> and not use grouping or <literal>ORDER BY</literal>). Cursors
>>> that are not simply updatable might work, or might not, depending on plan
>>> choice details; so in the worst case, an application might work in testing
>>> - and then fail in production.
>>> + and then fail in production. If <literal>FOR UPDATE</literal> is
>>> + specified, then the cursor is guaranteed to be updatable, or the
>>> + <command>DECLARE</command> command will error if an updatable cursor
>>> + cannot be created for the supplied query.
>>> </para>
>>
>> OK by me, except we don't usually use "error" as a verb. Either "fail"
>> or "throw an error" would read better IMO. Or you could just stop with
>> "guaranteed to be updatable"; I don't think the rest adds much.
>
> I have done as you suggested and just used the first part; patch
> attached and backpatched.
I think we should still add the second part, because it currently
doesn't say anything about that a cursor declaration might fail if an
updatable cursor cannot be created.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, bruce@momjian.us, tgl@sss.pgh.pa.us
Subject: Re: updatable cursors and ORDER BY
In-Reply-To: <b0af1f4a-b39f-5a18-fcd2-b4f2a4a0303e@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox