Skip site navigation (1) Skip section navigation (2)

RE: SELECT updatability clause defective.

From: "Jerome O'Neil" <joneil(at)combimatrix(dot)com>
To: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: RE: SELECT updatability clause defective.
Date: 2001-05-10 08:13:42
Message-ID: GCEAIKGJLCHNBFIMDEAPIEKICAAA.joneil@combimatrix.com (view raw or flat)
Thread:
Lists: pgsql-bugs
> I see it as part of declare cursor (13.1)
>
> <updatability clause> ::=
> 	FOR { READ ONLY | UPDATE [ OF <column name list> ] }
>
> However, I think the updatability clause means something
> different than our for update.  If I'm reading it write, I think
> it tells you whether or not you may do positioned updates on
> the cursor.

You're right, it is part of the cursor specification, and not the query
term. My bad for the confusion.

In the cursor context, it's used to declare what columns are
updateable through the cursor.  By adding the syntax to the
raw select statement, you can declare columns updateable
through the result set.  At least that's the intent of other
vendors.

-- SQL-92, and is unsupported by Postgres.
DECLARE  mycursor CURSOR
FOR
 SELECT foo,baz FROM bar
FOR UPDATE OF foo

-- Adheres to the BNF, and is not supported by Postgres
SELECT foo,baz FROM bar FOR UPDATE OF foo

-- Breaks the BNF but is supported by Postgres
SELECT foo,baz FROM bar FOR UPDATE OF bar

Which makes me wonder:  What is the point, if not to
restrict updatability?

What is the difference between:

-- Allow updates to everything.
SELECT * FROM bar FOR UPDATE

and

-- Allow updates to everything.
SELECT * FROM bar FOR UPDATE OF bar




In response to

Responses

pgsql-bugs by date

Next:From: Christian BreimannDate: 2001-05-10 08:25:10
Subject: exists <==> not exists ???
Previous:From: Vivek KheraDate: 2001-05-09 19:32:50
Subject: Re: freebsd sample startup script doesn't work

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group