David,
> I've got a transaction that does a few inserts, but it's OK for one
> specific one to fail in a specific way (adding a field that's already
> there).
> What's going on here, and how do I fix it?
In a short answer: you can't. Postgresql does not allow trapping of
exceptions; an exception will abort the transaction.
Your only reasonable option is to test for the failure condition in some way
to prevent an exception being raised.
(Your unreasonable option is to hack exception-handling for postgresql
transactions ...)
--
-Josh Berkus
Aglio Database Solutions
San Francisco