In python postgres sql , create and insert query is executing without error but while checking in the database it is not getting updated
Python code
cursor = self.connection.cursor()
try:
cursor.execute("INSERT INTO success(username,email)VALUES('test5','test@mail')")
print ("A row Inserted successfully")
except Exception as e:
print ("Unable to insert your data - ",e)
Output
A row Inserted successfully
But the data not truly inserted into database. The select query is working fine and displaying the data which is already available in the database not newly inserted.
select Query below
cursor.execute("select * from success")
record = cursor.fetchall()
print ("record",record)
output
record []
Note: All the database connections are working fine I have checked it already. Thanks in advance