cur = con.cursor()
cur.execute("SAVEPOINT a")
try:
- cur.execute("UPDATE jenkins_build SET build_end = '%s', status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
+ cur.execute("UPDATE jenkins_build SET build_end = to_timestamp('%s'), status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
con.commit()
except psycopg2.DatabaseError as e:
cur.execute("ROLLBACK TO a") # have to rollback after failed command
- logger.debug("UPDATE jenkins_build SET build_end = '%s', status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
+ logger.debug("UPDATE jenkins_build SET build_end = to_timestamp('%s'), status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
return cur.fetchone()[0]
def db_add_origin(con, origin):