On Friday 22 May 2009 12.01:05 Iwan wrote: > Naïvely, I thought you'd create an X, flush it, and then catch any > IntegrityError's thrown. [...]
I know that PostgreSQL can't continue in a transaction after an error, you
have to roll back the transaction. I don't know what the SQL standard says
on this, but that's how postgres has "always" behaved.
I guess you just have to query for your string to see if it's unique.
Performance-wise it shouldn't make a difference, and in Python, I usually
find a simple if even nicer than a try-except block.
cheers
-- vbi
--
Jeder Mensch ist einzigartig.
-- Benedetto Croce
signature.asc
Description: This is a digitally signed message part.
