Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python pg8000 1.9.4参数化语句错误不在pg8000 1.08中_Python_Postgresql - Fatal编程技术网

Python pg8000 1.9.4参数化语句错误不在pg8000 1.08中

Python pg8000 1.9.4参数化语句错误不在pg8000 1.08中,python,postgresql,Python,Postgresql,我希望有人能帮助我,因为我已经为这个问题挣扎了两天了 使用最新的pg8000驱动程序(1.9.4),我准备了一个带有参数的语句,当尝试执行该语句时,会出现以下错误: ValueError: invalid literal for int() with base 10: 'SELECT' 我发现使用pg8000驱动程序(1.08)时没有出现此错误(当我返回到我的开发环境时请注意) 这是我的密码: self._dbConnection = dbapi.connect(host=self.host,

我希望有人能帮助我,因为我已经为这个问题挣扎了两天了

使用最新的pg8000驱动程序(1.9.4),我准备了一个带有参数的语句,当尝试执行该语句时,会出现以下错误:

ValueError: invalid literal for int() with base 10: 'SELECT'
我发现使用pg8000驱动程序(1.08)时没有出现此错误(当我返回到我的开发环境时请注意)

这是我的密码:

self._dbConnection = dbapi.connect(host=self.host,
                                   user=self.user,
                                   password=self.pwd ,
                                   database=self.name,
                                   port=self.port)

stmt = "SELECT lb FROM vig.departement WHERE id = %s"
cursor = self.dbConnection.cursor()
cursor.execute(stmt, [1])
row = cursor.fetchone()
cursor.close()
我不知道我做错了什么,也不知道我是否遗漏了pg8000 1.08和1.9.4之间的内容

更多信息以防万一:我的数据库版本是PostgreSQL 8.3.8(来自
psql--version
),由Cent0S 5.3托管,我的客户端执行python脚本是在Cent0S 6.3上


谢谢您的帮助。

我是pg8000的贡献者,问题是pg8000不支持PostgreSQL 8.3。事实上,根据对Postgres的支持,8.3一般于2013年2月结束

这就解释了。。。所以如果我想处理8.3 postgresql数据库,我应该坚持使用pg8000 1.08?谢谢你的回答!