对于'in‘where子句,我有一个plpython查询
user_ids = [1,2,3]
query = "SELECT department from users where id in ($1)"
prepared_query = plpy.prepare(query, ['bigint'])
# not sure what the type should be if id is bigint
plpy.execute(prepared_query, user_ids)问题是我不确定争论的类型应该是什么
对于我尝试过的不同组合,我会得到错误:
有人把这个搞定了吗?文件记录不全。
发布于 2021-10-14 10:22:25
如果其他人有这个问题,我可以通过将where子句切换到where id = ANY($1)并使用bigint[]作为参数类型来解决这个问题。
https://dba.stackexchange.com/questions/301112
复制相似问题