【发布时间】:2020-08-22 15:00:01
【问题描述】:
我认为这是一个简单的问题,如何在 python 中编写 sql 查询?
### python3 code
# ok
row = await conn.fetchrow(
'SELECT * FROM users WHERE email = $1', user_email)
# NOT ok
user_pw = await conn.fetch(
'convert_from($1, $2)', row[2], 'UTF8')
asyncpg.exceptions.PostgresSyntaxError:在或附近出现语法错误 “convert_from”
【问题讨论】:
-
好吧
convert_from()是一个需要SELECT的函数 -
@a_horse_with_no_name 好的,我明天会检查并测试并报告结果。
标签: python-3.x postgresql hash bytea