Re: Protect a table against concurrent data changes while allowing to vacuum it

Поиск
Список
Период
Сортировка
От Sameer Kumar
Тема Re: Protect a table against concurrent data changes while allowing to vacuum it
Дата
Msg-id CADp-Sm5LUFNhLV=BMB3R6HTJnFsWCMqDE32W6812npb+8gkPkw@mail.gmail.com
обсуждение исходный текст
Ответ на Protect a table against concurrent data changes while allowing to vacuum it  (Vlad Arkhipov <arhipov@dc.baikal.ru>)
Ответы Re: Protect a table against concurrent data changes while allowing to vacuum it  (Vlad Arkhipov <arhipov@dc.baikal.ru>)
Список pgsql-general


On Wed, Jun 22, 2016 at 5:10 PM Vlad Arkhipov <arhipov@dc.baikal.ru> wrote:
Hello,

I have a constraint that requires a table to be locked before checking
it (i.e. no more than 2 records with the same value in the same column).
If I lock the table in the SHARE ROW EXCLUSIVE mode, any vacuuming (or
autovacuuming) process prevents me from checking the constraint. What
are possible solutions?

May be you would like to share-
- Table Structure
- PostgreSQL version

This will help people who would try to help you.

I think you might want to consider an optimistic way of locking your records, instead of locking them. Or look at advisory locks (but that depends on your Postgres version).
 


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
--
--
Best Regards
Sameer Kumar | DB Solution Architect 
ASHNIK PTE. LTD.

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069 533

T: +65 6438 3504 | M: +65 8110 0350 | www.ashnik.com

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

Предыдущее
От: Vlad Arkhipov
Дата:
Сообщение: Protect a table against concurrent data changes while allowing to vacuum it
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: Protect a table against concurrent data changes while allowing to vacuum it