On 11/12/2007, Mason Hale <masonhale(at)gmail(dot)com> wrote:
>
>
> I'm thinking that an insert trigger that ensures (SELECT count(*) FROM
> page WHERE hashtext(url) = hashtext('http://www.postgresql.org'<http://www.postgresql.org%27>)
> 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.