Re: Determine if FOR UPDATE or FOR SHARE was used?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Determine if FOR UPDATE or FOR SHARE was used?
Дата
Msg-id 4850.1552884319@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Determine if FOR UPDATE or FOR SHARE was used?  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Determine if FOR UPDATE or FOR SHARE was used?
Список pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> Given a Portal, or an _SPI_plan, is there a practical way to tell whether
> it came from a query with FOR UPDATE or FOR SHARE?

In principle, you could do something like drilling down into the plan
tree to see if there's a LockRows node, but this wouldn't necessarily
be a great idea from a modularity or maintainability standpoint.

I think it would help to take two steps back and ask why you want
to know this, and what exactly is it that you want to know, anyhow.
What does it matter if there's FOR SHARE in the query?  Does it
matter if the FOR SHARE targets only some tables (and do you
care which ones?)  How would your answer change if the FOR SHARE
were buried down in a CTE subquery?  Why are you only interested
in these cases, and not INSERT/UPDATE/DELETE?

            regards, tom lane


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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Performance issue in foreign-key-aware join estimation
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Unaccent extension python script Issue in Windows