Re: Want to acquire lock on tables where primary of one table isforeign key on othere

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Want to acquire lock on tables where primary of one table isforeign key on othere
Дата
Msg-id CAF-3MvNXowd7rrRNqF3oaHdz+J1W5zrm8yR+3LGx5Fa14s+oQw@mail.gmail.com
обсуждение исходный текст
Ответ на Fwd: Want to acquire lock on tables where primary of one table isforeign key on othere  (Abhishek Tripathi <postforabhishek@gmail.com>)
Ответы Re: Want to acquire lock on tables where primary of one table isforeign key on othere
Список pgsql-general
On Thu, 11 Oct 2018 at 16:38, Abhishek Tripathi
<postforabhishek@gmail.com> wrote:
> Actually I have acquired a "Select for Update" on a table whose id is refrence as a foreign key on another table So I
wantthose table won't update until there is lock. Is it possible? Becuase postgres is acquiring lock but AccessShare
Lockwhich allow to write on those table How I restrict this. 

For what purpose do you want that? What is inadequate about the lock
that Postgres acquires?

Table locks are very rarely what you want, as it blocks all concurrent
access to the entire table, while that is only necessary for a few
rarely used corner cases; a foreign key update is not among those.

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.


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

Предыдущее
От: Bryce Pepper
Дата:
Сообщение: RE: RHEL 7 (systemd) reboot
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Advice on logging strategy