Re: Updatable cursor doubt

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Updatable cursor doubt
Дата
Msg-id 46DD226F.7060602@enterprisedb.com
обсуждение исходный текст
Ответ на Updatable cursor doubt  ("FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au>)
Ответы Re: Updatable cursor doubt  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Updatable cursor doubt  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
FAST PostgreSQL wrote:
> In CVS HEAD
> 
> workspace=# begin;
> BEGIN
> workspace=# declare cu cursor for select * from t1 for read only;
> DECLARE CURSOR
> workspace=# fetch cu;
>  a
> ---
>  1
> (1 row)
> 
> workspace=# delete from t1 where current of cu;
> DELETE 1
> workspace=# commit;
> COMMIT
> 
> Is this the intended behaviour? If so should we remove the 'READ ONLY'
> clause from the allowable syntax?
> 
> The documentation does not have 'READ ONLY' as part of the cursor syntax
> anymore.

FOR READ ONLY is actually part of the SELECT syntax. It's been accepted
for at least down to version 7.4, probably even longer than that, but it
hasn't been documented. It's accepted for the sake of compatibility with
other DBMSs (and SQL standard?), it doesn't do anything in PostgreSQL.

Now, whether we should make an effort to not allow updating a cursor on
a query with FOR READ ONLY, that's another question. I don't think it's
worth the effort, and it wouldn't really gain us anything. We probably
should mention it in the manual, in the Compatibility section of SELECT
reference page.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: "Hiroshi Saito"
Дата:
Сообщение: Desirable standard library of Kerberos at windows.
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: integrated tsearch has different results than tsearch2