Answer the question
In order to leave comments, you need to log in
Why can't write to PostrgeSQL DB using Python?
I want to write data to the database using Python in this way
cursor.execute("INSERT INTO maps_data (sity, sh, dg, prem) VALUES (Город, 12.345, 12.345, тексттексттекст);")
cursor.execute("INSERT INTO maps_data (sity, sh, dg, prem) VALUES (Город, 12.345, 12.345, тексттексттекст);")
conn.commit()
cursor.close()
conn.close()
Answer the question
In order to leave comments, you need to log in
Wrap strings in single quotes.
cursor.execute("INSERT INTO maps_data (sity, sh, dg, prem) VALUES ('Город', 12.345, 12.345, 'тексттексттекст');")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question