Re: basic pg lock question - Mailing list pgsql-general

From PFC
Subject Re: basic pg lock question
Date
Msg-id opsll864r7th1vuj@musicbox
Whole thread Raw
In response to Re: basic pg lock question  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
> To use this to prevent simultaneous inserts of the same data (for
> example if two employees try to insert the same contact into the DB), I
> suppose you could use a constraint (before insert) that checks that
> there is no data matching the md5 checksum, right?


CREATE TABLE blah
(
    mymd5    TEXT NOT NULL,
    UNIQUE( mymd5 )
);

will do this for you automatically and create an index to enforce it
(don'tcreate another index !)


pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: basic pg lock question
Next
From: sid tow
Date:
Subject: Re: Problem with the sequence