I'm implementing a recursive upsert operation for an object whose primary key also contains a foreignkey, and I'd like to get some more info from IntegrityError, namely whether integrity was violated because the foreignkey didn't exist (yet) or I am trying to insert a duplicate pkey. In the former case, I'd go and insert the parent, in the latter, I'd just ignore it and rollback (since the state is already end state)
Is there a way to fish this out from IntegrityError or do I need to catch DBAPI exceptions instead? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.