On 11/12/2007, Mason Hale <masonhale@xxxxxxxxx> wrote:
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.
I'm thinking that an insert trigger that ensures (SELECT count(*) FROM page WHERE hashtext(url) = hashtext(' http://www.postgresql.org') AND url = "" href="http://www.postgresql.org" target="_blank" > 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.