same code same tables but not the same result(use flask and postgres)

Frank Liou fk26541598fk at gmail.com
Wed Jul 9 03:14:56 EDT 2014


i use flask connect to postgres

def post_insert(username):
    conn = engine.connect()
    encoded = base64.b64encode(username.encode('utf-8'))
    puresql = sqla.text("INSERT INTO friends(name) VALUES(:encoded)")
    conn.execute(puresql,encoded = encoded)


i insert username encode with base64 to my database

but

one i got 

MTIzNDU2Nzg=   <==it's right

anoter i got

\x4d54497a4e4455324e7a673d

i change database to another database

but tables is use same code to create

what 's wrong??



More information about the Python-list mailing list