Python psycopg2 DELETE data in AWS, no result, no error [duplicate]
This question already has an answer here:
Psycopg2 insert not saved
1 answer
I try to delete data in a table in AWS. The code below works well if I pull data from AWS.
import psycopg2
import pandas as pd
con=psycopg2.connect(dbname= My_Credential.....)
cur = con.cursor()
sql = """
DELETE FROM my_table
"""
cur.execute(sql)
After runing the code, I don't have any error message, but if I go check the data in that table, the data is still there. I wonder if I need to add any code like to COMMIT the change?
please advise. thanks
python-3.x postgresql amazon-web-services
marked as duplicate by cmaher, Community♦ Nov 20 '18 at 21:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Psycopg2 insert not saved
1 answer
I try to delete data in a table in AWS. The code below works well if I pull data from AWS.
import psycopg2
import pandas as pd
con=psycopg2.connect(dbname= My_Credential.....)
cur = con.cursor()
sql = """
DELETE FROM my_table
"""
cur.execute(sql)
After runing the code, I don't have any error message, but if I go check the data in that table, the data is still there. I wonder if I need to add any code like to COMMIT the change?
please advise. thanks
python-3.x postgresql amazon-web-services
marked as duplicate by cmaher, Community♦ Nov 20 '18 at 21:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Psycopg2 insert not saved
1 answer
I try to delete data in a table in AWS. The code below works well if I pull data from AWS.
import psycopg2
import pandas as pd
con=psycopg2.connect(dbname= My_Credential.....)
cur = con.cursor()
sql = """
DELETE FROM my_table
"""
cur.execute(sql)
After runing the code, I don't have any error message, but if I go check the data in that table, the data is still there. I wonder if I need to add any code like to COMMIT the change?
please advise. thanks
python-3.x postgresql amazon-web-services
This question already has an answer here:
Psycopg2 insert not saved
1 answer
I try to delete data in a table in AWS. The code below works well if I pull data from AWS.
import psycopg2
import pandas as pd
con=psycopg2.connect(dbname= My_Credential.....)
cur = con.cursor()
sql = """
DELETE FROM my_table
"""
cur.execute(sql)
After runing the code, I don't have any error message, but if I go check the data in that table, the data is still there. I wonder if I need to add any code like to COMMIT the change?
please advise. thanks
This question already has an answer here:
Psycopg2 insert not saved
1 answer
python-3.x postgresql amazon-web-services
python-3.x postgresql amazon-web-services
asked Nov 20 '18 at 17:31
PyBossPyBoss
477
477
marked as duplicate by cmaher, Community♦ Nov 20 '18 at 21:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by cmaher, Community♦ Nov 20 '18 at 21:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I just figured out. I need to add
con.commit()
to make it work
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I just figured out. I need to add
con.commit()
to make it work
add a comment |
I just figured out. I need to add
con.commit()
to make it work
add a comment |
I just figured out. I need to add
con.commit()
to make it work
I just figured out. I need to add
con.commit()
to make it work
answered Nov 20 '18 at 17:34
PyBossPyBoss
477
477
add a comment |
add a comment |