Re: For update clause

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: For update clause
Дата
Msg-id 201006152004.o5FK46616620@momjian.us
обсуждение исходный текст
Ответ на For update clause  (Florence Cousin <cousinflo@free.fr>)
Ответы Re: For update clause  (Florence Cousin <cousinflo@free.fr>)
Список pgsql-docs
Florence Cousin wrote:
> Hi,
>
> I am one of the french translators of the documentation. I am translating the
> reference page of SELECT, but I fail to understand this sentence about the FOR
> UPDATE clause (  http://www.postgresql.org/docs/9.0/static/sql-
> select.html#SQL-FOR-UPDATE-SHARE   )
>
> ---------------
> In addition, rows that satisfied the query conditions as of the query snapshot
> will be locked, although they will not be returned if they have since been
> updated to not satisfy the query conditions.
> ------------------
>
> Could anyone please explain it to me, so that I can translate it properly? A
> word for word translation has really no meaning.

Wow, that is a confusing double-negative sentence.  I have updated the
text to be:

    In addition, rows that satisfied the query conditions as of the
    query snapshot will be locked, although they will not be returned
    if they were updated after the snapshot and no longer satisfy the
    query conditions.

What it is saying is that SELECT FOR UPDATE will lock all rows that
match the SELECT query using the current snapshot, but the returned rows
might be different because the rows were changed after the snapshot was
taken, and a SELECT FOR UPDATE will return the rows as UPDATE will see
them, which might not match the SELECT snapshot.  Yeah, it is confusing.

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

  + None of us is going to be here forever. +

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

Предыдущее
От: Florence Cousin
Дата:
Сообщение: For update clause
Следующее
От: Florence Cousin
Дата:
Сообщение: Re: For update clause