Re: basic pg lock question

Поиск
Список
Период
Сортировка
От PFC
Тема Re: basic pg lock question
Дата
Msg-id opsll864r7th1vuj@musicbox
обсуждение исходный текст
Ответ на Re: basic pg lock question  (Alban Hertroys <alban@magproductions.nl>)
Список 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 по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: basic pg lock question
Следующее
От: sid tow
Дата:
Сообщение: Re: Problem with the sequence