Re: Using hashtext and unique constraints together

Поиск
Список
Период
Сортировка
От Peter Childs
Тема Re: Using hashtext and unique constraints together
Дата
Msg-id a2de01dd0712120009w298b7009qd1c3cf919b3881aa@mail.gmail.com
обсуждение исходный текст
Ответ на Using hashtext and unique constraints together  ("Mason Hale" <masonhale@gmail.com>)
Список pgsql-general


On 11/12/2007, Mason Hale <masonhale@gmail.com> wrote:

I'm thinking that an insert trigger that ensures (SELECT count(*) FROM page WHERE hashtext(url) = hashtext(' http://www.postgresql.org') AND url = ' http://www.postgresql.org' ) = 0 won't work given MVCC, as two transactions could simultaneously insert the same url at the same time.


Why not so long as it also locks the table (share lock should be enough) but it could slow the table down if lots of transactions write to the table at once.

Regards

Peter.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: what is the date format in binary query results
Следующее
От: "Peter Childs"
Дата:
Сообщение: Re: top posting