【发布时间】:2018-12-16 14:40:01
【问题描述】:
Psycopg2 不断给我以下错误:
psycopg2.ProgrammingError: operator does not exist: numrange @> integer
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts
我想从我的 postgres 数据库中具有 int4range 类型的列的表中获取值(例如 1)的范围。
select price,weight_kgs @>1 from weight_categories;
注意:当我在终端中使用代码时,代码会运行
这是我的表的结构:
Column | Type | Collation | Nullable |
Default
------------+----------+-----------+----------+-------------------
-----------------------------------
weight_id | integer | | not null |
nextval('weight_categories_weight_id_seq'::regclass)
weight_kgs | numrange | | not null |
price | integer | | not null |
【问题讨论】:
标签: python-3.x psycopg2 psql