Как передать список оператору IN в запросе, используя именованные аргументы psycopg?
Пример:
< pre class="lang-py Prettyprint-override">cur.execute("""
SELECT name
FROM users
WHERE id IN (%(ids)s)
""",
{"ids": [1, 2, 3]})
Когда я это делаю, я получаю следующее сообщение об ошибке:
psycopg.errors.UndefinedFunction: operator does not exist: integer = smallint[]
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Подробнее здесь: https://stackoverflow.com/questions/748 ... -arguments