Re: Add further details to ROW SHARE table level lock modes section

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Add further details to ROW SHARE table level lock modes section
Дата
Msg-id 202204131800.4kk67cjmeuqh@alvherre.pgsql
обсуждение исходный текст
Ответ на Add further details to ROW SHARE table level lock modes section  (PG Doc comments form <noreply@postgresql.org>)
Ответы Re: Add further details to ROW SHARE table level lock modes section  (Erikjan Rijkers <er@xs4all.nl>)
Список pgsql-docs
On 2022-Apr-04, PG Doc comments form wrote:

> I propose that it would be useful to explicitly state that `SELECT FOR KEY
> SHARE` AND `SELECT FOR NO KEY UPDATE` commands also acquire the ROW SHARE
> table level lock on target table(s). That is:
> ```
> Conflicts with the EXCLUSIVE and ACCESS EXCLUSIVE lock modes.
> 
> The SELECT FOR UPDATE, SELECT FOR NO KEY UPDATE,  SELECT FOR SHARE, and
> SELECT FOR KEY SHARE commands acquire a lock of this mode on the target
> table(s) (in addition to ACCESS SHARE locks on any other tables that are
> referenced but not selected FOR UPDATE/FOR SHARE).
> ```

I agree we need an update here.  But the original wording seems a bit
off; I think we should say SELECT is a command, and that the FOR bits
are options thereof.  Maybe something like this:

        <para>
         The <command>SELECT</command> command acquires a lock of this mode
         on all tables on which one of the <option>FOR UPDATE</option>,
         <option>FOR NO KEY UPDATE</option>,
         <option>FOR SHARE</option>, or
         <option>FOR KEY SHARE</option> options is specified
         (in addition to <literal>ACCESS SHARE</literal> locks on any other
         tables that are referenced without any explicit
         <option>FOR ...</option> locking option).
        </para>

Thoughts?

Grammar check: "one of the a,b,c options IS specified" or "one of the
a,b,c options ARE specified"?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "GIN and GiST Index Types" page is about usage in full text search, but looks general purpose
Следующее
От: Erikjan Rijkers
Дата:
Сообщение: Re: Add further details to ROW SHARE table level lock modes section