#!/usr/bin/python3

import psycopg2

try:
    con = psycopg2.connect(
        'host=localhost dbname=projeto\
         user=admin password=4linux'
    )

    cur = con.cursor()
except Exception as e:
        print('Erro: {}'. format(e))
        exit()

try:
    cur.execute("update usuarios set dtnasc='1982-11-15' where id='1'")
    con.commit()
except Exception as e:
    con.rollback()
    print('Erro: {}'.format(e))
finally:
    cur.close()
    con.close()
    