Re: How to explicitly lock and unlock tables in pgsql?

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: How to explicitly lock and unlock tables in pgsql?
Дата
Msg-id eed4b6bcda07d197f54a5ea4c1c1194c67778673.camel@cybertec.at
обсуждение исходный текст
Ответ на How to explicitly lock and unlock tables in pgsql?  (Shaozhong SHI <shishaozhong@gmail.com>)
Ответы Re: How to explicitly lock and unlock tables in pgsql?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
On Wed, 2022-03-16 at 20:30 +0000, Shaozhong SHI wrote:
> Table locks present a barrier for progressing queries.
> 
> How to explicitly lock and unlock tables in pgsql, so that we can guarantee the progress of running scripts?

You cannot unlock tables except by ending the transaction which took the lock.

The first thing you should do is to make sure that all your database transactions are short.

Also, you should nevr explicitly lock tables.  Table locks are taken automatically
by the SQL statements you are executing.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




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

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: How to explicitly lock and unlock tables in pgsql?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: PSQL bug?