i have just started diving into raw queries in django.
i am trying to change a schema name in my postgres, but my SQL query does not work
here's the code that i run in django shell:
>>> from django.db import connection
>>> cursor = connection.cursor()
>>> query = "ALTER SCHEMA %s RENAME TO %s;"
>>> data = ('thor', 'thor1')
>>> cursor.execute(query, data)
Error:
django.db.utils.ProgrammingError: syntax error at or near "'thor'"
LINE 1: ALTER SCHEMA 'thor' RENAME TO 'thor1';
i believe that those quotes are the root of my problem.
any idea how can i make this work ?