Search Postgresql Archives

Re: Need help writing exclusion constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2011-01-15 at 21:32 +0100, Tomas Vondra wrote:
> >     ALTER TABLE event ADD CONSTRAINT event_overlap
> >              CHECK(overlap_at_dest(destination_id, starts, ends));
> 
> There's a race condition 

...

> One way to fix this is locking 

I do not recommend locking. In fact, the primary reason that exclusion
constraints exist is to prevent unnecessary locking for problems exactly
like this.

I included some links in my other reply that demonstrate how to avoid
that excessive locking while still being safe from race conditions.

Regards,
	Jeff Davis


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux