def pgexecute(dbconn, oper, args=None):
    curs = dbconn.cursor()
    try:
        curs.execute(oper, args)
    except:
        curs.close()
        dbconn.rollback()
        raise
    return curs
Execute an operation using a cursor
dataset/ETHPy150Open perseas/Pyrseas/pyrseas/lib/dbutils.py/pgexecute