heroku postgres sql changes not reflected in db I wrote this program 

import psycopg2 


try:
    #connect to db

    cursor = connection.cursor()

except Exception as e:
    raise e
else:
    print("connection Success")
cmd = ""
while(True):
    cmd= input("Enter cmd")
    if cmd == "CLOSE":
        break
    try:

        cursor.execute(cmd)
        pass
    except Exception as e:
        print("Err")
        print(e)
        pass
    else:
        record = ""
        try: 
            record = cursor.fetchall()
        except Exception as e:

            print(e)


        print("Success ")
        print(record)

        pass
    finally:
        pass

cursor.close()
connection.close()
print("all close")


Weirdly, it worked fine yesterday for sometime. 
However now changes are not reflected in db (when checked through heroku dataclip) but can be seen through python app before closing the session.Only .
I an sure I haven't crossed any limit of the hobby dev plan.

Curious enough the primary key still increments.
Output example-


this query(insert into info(name,nickname,ismetro) values('abc', 'xyx','n') worked a while ago.
You're never committing your transaction. Add connection.commit() before you call cursor.close(). Docs here.