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

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Vlad Arkhipov *EXTERN*'" <arhipov(at)dc(dot)baikal(dot)ru>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Protect a table against concurrent data changes while allowing to vacuum it
Date: 2016-06-22 09:58:53
Message-ID: A737B7A37273E048B164557ADEF4A58B53863C2E@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vlad Arkhipov wrote:
> 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?

Can you describe your check in more detail?
Why don't you use simple unique constraints?

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vlad Arkhipov 2016-06-22 10:07:46 Re: Protect a table against concurrent data changes while allowing to vacuum it
Previous Message Sameer Kumar 2016-06-22 09:20:34 Re: Protect a table against concurrent data changes while allowing to vacuum it