[sqlalchemy] Re: How to ignore primary key errors on insert

2008-05-07 Thread Alexis B
Oh right, I'll do this . ( I was looking so hard on postgres features that I forgot the python ones ... ) Thanks On May 6, 4:40 pm, Michael Bayer [EMAIL PROTECTED] wrote: just use try/except from sqlalchemy import exceptions try: engine.execute(mytable.insert(), **kwargs) except

[sqlalchemy] Re: How to ignore primary key errors on insert

2008-05-06 Thread Michael Bayer
just use try/except from sqlalchemy import exceptions try: engine.execute(mytable.insert(), **kwargs) except exceptions.IntegrityError, e: print Error !, e, well, I guess we'll ignore it. engine.execute(some_other_insert_statement ... ) On May 6, 2008, at 10:06 AM, Alexis B wrote: