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

From: Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Protect a table against concurrent data changes while allowing to vacuum it
Date: 2016-06-22 09:10:04
Message-ID: 576A55EC.3060403@dc.baikal.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sameer Kumar 2016-06-22 09:20:34 Re: Protect a table against concurrent data changes while allowing to vacuum it
Previous Message Erik Gustafson 2016-06-22 08:25:59 Re: optimizing a query