RE: SELECT updatability clause defective.

Поиск
Список
Период
Сортировка
От Jerome O'Neil
Тема RE: SELECT updatability clause defective.
Дата
Msg-id GCEAIKGJLCHNBFIMDEAPIEKICAAA.joneil@combimatrix.com
обсуждение исходный текст
Ответ на Re: SELECT updatability clause defective.  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: SELECT updatability clause defective.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Fariba Noorbakhsh
Дата:
Сообщение: instalation problems!
Следующее
От: "Eric Pare"
Дата:
Сообщение: order by using functions under unions