Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
117 views
in Technique[技术] by (71.8m points)

python - Update multiple columns with psycopg2

I can I update multiple columns for a particular row with psycopg2? I have tried this but I get the error I show bellow:

cursor = postgres_conn.cursor()
sql_update = "UPDATE table_name SET a=%s, b=%s, c=%s WHERE url=%s"
cursor.execute(sql_update,(1,2,3,url))


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
question from:https://stackoverflow.com/questions/65645579/update-multiple-columns-with-psycopg2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...