Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dbname = "test"
- cursor.execute(cursor.mogrify("DROP DATABASE %s;"), (dbname,))
- cursor.execute("DROP DATABASE %s;", (dbname,))
- Error syntax error at or near "'test'"
- LINE 1: DROP DATABASE 'test';
- from psycopg2.extensions import AsIs
- ...
- cursor.execute("DROP TABLE %(table)s", {"table": AsIs("my_table")})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement