Re: updatable cursors and ORDER BY

2018-06-11 Thread Tom Lane
Peter Eisentraut writes: > 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. I still think it wouldn't add anything. Any other error in the command would cause the cursor

Re: updatable cursors and ORDER BY

2018-06-11 Thread Peter Eisentraut
On 5/28/18 13:17, Bruce Momjian wrote: > On Thu, May 10, 2018 at 12:55:23PM -0400, Tom Lane wrote: >> Peter Eisentraut 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 @@ Note

Re: updatable cursors and ORDER BY

2018-05-28 Thread Bruce Momjian
On Thu, May 10, 2018 at 12:55:23PM -0400, Tom Lane wrote: > Peter Eisentraut 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 @@ Notes > > and not use grouping or ORDER

Re: updatable cursors and ORDER BY

2018-05-10 Thread Tom Lane
Peter Eisentraut 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 @@ Notes > and not use grouping or ORDER BY). Cursors > that are not simply updatable might work, or mig

Re: updatable cursors and ORDER BY

2018-05-10 Thread Peter Eisentraut
On 5/9/18 22:57, Tom Lane wrote: > I think you misread that note: it says nothing about what is allowed > in DECLARE CURSOR per se. It is talking about whether you can apply > UPDATE/DELETE WHERE CURRENT OF to that cursor. Moreover, what it says > is that if you use FOR UPDATE then such an UPDATE

Re: updatable cursors and ORDER BY

2018-05-09 Thread David G. Johnston
On Wed, May 9, 2018 at 7:43 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > The DECLARE reference page says: > > """ > Another reason to use FOR UPDATE is that without it, a subsequent WHERE > CURRENT OF might fail if the cursor query does not meet the SQL > standard's rules for

Re: updatable cursors and ORDER BY

2018-05-09 Thread Tom Lane
Peter Eisentraut writes: > The DECLARE reference page says: > """ > Another reason to use FOR UPDATE is that without it, a subsequent WHERE > CURRENT OF might fail if the cursor query does not meet the SQL > standard's rules for being “simply updatable” (in particular, the cursor > must reference

updatable cursors and ORDER BY

2018-05-09 Thread Peter Eisentraut
The DECLARE reference page says: """ Another reason to use FOR UPDATE is that without it, a subsequent WHERE CURRENT OF might fail if the cursor query does not meet the SQL standard's rules for being “simply updatable” (in particular, the cursor must reference just one table and not use grouping o