Re: [GENERAL] plpython and error catching

2007-11-19 Thread Adrian Klaver
On Monday 19 November 2007 10:37 am, Sean Davis wrote: > What is the expected behavior of a construct like this: > > def insert_xml(elem): > id=int(elem.findtext('PMID')) > try: > plpy.execute(plan,[unicode(ET.tostring(elem)),id]) > except: > plpy.execute(plan2,[unicode(

[GENERAL] plpython and error catching

2007-11-19 Thread Sean Davis
What is the expected behavior of a construct like this: def insert_xml(elem): id=int(elem.findtext('PMID')) try: plpy.execute(plan,[unicode(ET.tostring(elem)),id]) except: plpy.execute(plan2,[unicode(ET.tostring(elem)),id]) id is a primary key on the table into which I