Re: basic pg lock question

From: PFC <lists(at)boutiquenumerique(dot)com>
To: "Alban Hertroys" <alban(at)magproductions(dot)nl>, "Scott Marlowe" <smarlowe(at)g2switchworks(dot)com>
Cc: rschumeyer(at)ieee(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: basic pg lock question
Date: 2005-02-03 10:10:06
Message-ID: opsll864r7th1vuj@musicbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 !)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message sid tow 2005-02-03 10:11:31 Re: Problem with the sequence
Previous Message Alban Hertroys 2005-02-03 09:51:02 Re: basic pg lock question