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

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -