python - Updating table with percent sign in column name -
i'm connected postgresql database psycopg2. i'm trying update column, column name has percent sign in (that can't change).
i'm trying do:
qry = """update x set "foo%" = %s""" cursor.execute(qry, some_value) unfortunately doesn't work. psycopg2 gives bizarre error list index out of range. how can escape it?
if you're using format strings, %s in yours, need use %% literal percent sign.
Comments
Post a Comment