Search Postgresql Archives

Re: basic pg lock question

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

 




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 !)


---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

[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