Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. dbname = "test"
  2. cursor.execute(cursor.mogrify("DROP DATABASE %s;"), (dbname,))
  3.  
  4. cursor.execute("DROP DATABASE %s;", (dbname,))
  5.  
  6. Error syntax error at or near "'test'"
  7. LINE 1: DROP DATABASE 'test';
  8.  
  9. from psycopg2.extensions import AsIs
  10. ...
  11. cursor.execute("DROP TABLE %(table)s", {"table": AsIs("my_table")})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement