pg-promise - 错误运算符不存在:bigint = bigint[]
pg-promise - Error operator does not exist: bigint = bigint[]
我正在尝试 运行 查询:
let query =
`
DELETE FROM
${table_name}
WHERE
_id IN (::bigint[])
AND
account_id =
`
let fields =
[
_ids,
account_id,
]
但它给我错误:
operator does not exist: bigint = bigint[]
_ids
是一个数组。
注意
实施答案后我遇到的错误是:
GraphQLError: Int cannot represent non-integer value: []
这只是一个 GraphQL 错误,与 postgres 无关。
IN
运算符需要 set of rows with exactly one column, or a parenthesized list of scalar expressions。它不接受数组。
One answer 建议 :list
,它告诉 pg-promise 做正确的事:
WHERE _id IN (:list)
Another answer suggests = any
, where ANY
is a Postgres operator 确实接受数组:
WHERE _id = ANY (::int[])
我正在尝试 运行 查询:
let query =
`
DELETE FROM
${table_name}
WHERE
_id IN (::bigint[])
AND
account_id =
`
let fields =
[
_ids,
account_id,
]
但它给我错误:
operator does not exist: bigint = bigint[]
_ids
是一个数组。
注意
实施答案后我遇到的错误是:
GraphQLError: Int cannot represent non-integer value: []
这只是一个 GraphQL 错误,与 postgres 无关。
IN
运算符需要 set of rows with exactly one column, or a parenthesized list of scalar expressions。它不接受数组。
One answer 建议 :list
,它告诉 pg-promise 做正确的事:
WHERE _id IN (:list)
Another answer suggests = any
, where ANY
is a Postgres operator 确实接受数组:
WHERE _id = ANY (::int[])