Answer the question
In order to leave comments, you need to log in
How to properly update postgresql?
Hello.
How to do something after updating the records in the database, the order of the records did not change.
Now I'm doing this:
import psycopg2
connection = psycopg2.connect(database = "contacts", user = "???", password = "???", host="localhost", port="5432")
c = connection.cursor()
.....
query = "UPDATE app_contacts SET url = %s, seen = %s WHERE id = %s;"
data = (website, "1", item[0])
c.execute(query, data)
1
2
3
...
N
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question