What is the current status of FOR UPDATE cursors ?

Started by Hannu Krosingalmost 14 years ago4 messageshackers
Jump to latest
#1Hannu Krosing
hannu@tm.ee

What is the current status of FOR UPDATE cursors ?

older docs claim that the syntax is supported, but gives an error

http://www.postgresql.org/docs/8.2/static/sql-declare.html

docs for 9.1 do not have FOR UPDATE in main section

http://www.postgresql.org/docs/9.1/static/sql-declare.html

but then discuss using for update cursors further down.

--
-------
Hannu Krosing
PostgreSQL Unlimited Scalability and Performance Consultant
2ndQuadrant Nordic
PG Admin Book: http://www.2ndQuadrant.com/books/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hannu Krosing (#1)
Re: What is the current status of FOR UPDATE cursors ?

Hannu Krosing <hannu@2ndQuadrant.com> writes:

What is the current status of FOR UPDATE cursors ?

Same as it's been for a long time: FOR UPDATE [ OF table_name ]
works fine.

older docs claim that the syntax is supported, but gives an error
http://www.postgresql.org/docs/8.2/static/sql-declare.html

Old docs incorrectly said that it was FOR UPDATE [ OF column_name ]
but we have never implemented it that way.

regards, tom lane

#3Hannu Krosing
hannu@tm.ee
In reply to: Tom Lane (#2)
Re: What is the current status of FOR UPDATE cursors ?

On Sun, 2012-05-06 at 13:17 -0400, Tom Lane wrote:

Hannu Krosing <hannu@2ndQuadrant.com> writes:

What is the current status of FOR UPDATE cursors ?

Same as it's been for a long time: FOR UPDATE [ OF table_name ]
works fine.

Ok, then it is just documentation fix

currently it is missing from \h declare and docs

hannu@hvost:~/work/pg92$ TESTINST/bin/psql -p 9200 -h /tmp
psql (9.2devel)
Type "help" for help.

hannu=# \h declare
Command: DECLARE
Description: define a cursor
Syntax:
DECLARE name [ BINARY ] [ INSENSITIVE ] [ [ NO ] SCROLL ]
CURSOR [ { WITH | WITHOUT } HOLD ] FOR query

hannu=#

Show quoted text

older docs claim that the syntax is supported, but gives an error
http://www.postgresql.org/docs/8.2/static/sql-declare.html

Old docs incorrectly said that it was FOR UPDATE [ OF column_name ]
but we have never implemented it that way.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Hannu Krosing (#3)
Re: What is the current status of FOR UPDATE cursors ?

On Sun, May 6, 2012 at 10:55:54PM +0200, Hannu Krosing wrote:

On Sun, 2012-05-06 at 13:17 -0400, Tom Lane wrote:

Hannu Krosing <hannu@2ndQuadrant.com> writes:

What is the current status of FOR UPDATE cursors ?

Same as it's been for a long time: FOR UPDATE [ OF table_name ]
works fine.

Ok, then it is just documentation fix

currently it is missing from \h declare and docs

hannu@hvost:~/work/pg92$ TESTINST/bin/psql -p 9200 -h /tmp
psql (9.2devel)
Type "help" for help.

hannu=# \h declare
Command: DECLARE
Description: define a cursor
Syntax:
DECLARE name [ BINARY ] [ INSENSITIVE ] [ [ NO ] SCROLL ]
CURSOR [ { WITH | WITHOUT } HOLD ] FOR query

hannu=#

older docs claim that the syntax is supported, but gives an error
http://www.postgresql.org/docs/8.2/static/sql-declare.html

Old docs incorrectly said that it was FOR UPDATE [ OF column_name ]
but we have never implemented it that way.

What are you suggesting is missing from the docs?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +