python psycopg2 cursor.execute(“ DROP TABLE IF EXISTS ...”)引发SyntaxError。为什么,这怎么了?

$ python

 Python 3.6.8 (default,Oct  7 2019,12:59:55)
 [GCC 8.3.0] on linux
 >>> import psycopg2
 >>> db = psycopg2.connect("dbname= .....")
 >>> cur = db.cursor()
 >>> cur.execute("DROP TABLE IF EXISTS blahblah")
 Traceback (most recent call last):

   File "<stdin>",line 1,in <module>
 psycopg2.errors.SyntaxError: syntax error at or near "blahblah"
 LINE 1: DROP TABLE IF EXISTS blahblah
                              ^

所有其他SQL-Expr执行(SELECT等)均定期响应。它让我发疯:((请问有人吗?二手的Postgres托管在Heroku。Thnx。

syzr12345 回答:python psycopg2 cursor.execute(“ DROP TABLE IF EXISTS ...”)引发SyntaxError。为什么,这怎么了?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3098451.html

大家都在问