I have a query that I want to append to a file (to generate a list of queries) that will be executed later.
location_filter="SELECT id FROM developers WHERE location='%s'"
out_file.write((location_filter, (location)))
But the output that gets written can't be executed in pgadmin:
("SELECT id FROM developers WHERE location='%s'", u'Seattle')
How can I safely generate this statement?