I'm trying to perform an upsert in postgreSQL. Using this post as a reference Insert, on duplicate update in PostgreSQL?
I'm just not sure how to sanitize my data properly.
Currently I am trying
"BEGIN; INSERT INTO clients (id, name, phone, contact) VALUES ('{0}','{1}','{2}','{3}') ON CONFLICT (id) DO UPDATE SET name = '{1}', phone = '{2}', contact= '{3}';".format(data['id'], data['name'], data['phone'], data['contact']);
I believe there is an issue with my DO UPDATE SET command but I am not sure exactly what.