执行简单查询时出现运算符不匹配错误。这是什么原因造成的?
dev_db=# `select * from registrants where user=1;`
错误:运算符不存在:名称 = 整数
LINE 1: select * from registrants where user=1;
^
提示:没有运算符与给定名称和参数类型匹配。您可能需要添加显式类型转换。
表定义:
dev_db=# \d+ 注册人
表“public.registrants”
专栏 | 类型 | 修饰符 | 存储 | 描述
--------------+--------------+-------- ------------+---------+-------------
用户 | 整数 | 不为空 | 平原 |
学位 | 正文 | | 扩展 |
标题 | 正文 | | 扩展 |
组织 | 正文 | | 扩展 |
地址 | 正文 | | 扩展 |
城市| 正文 | | 扩展 |
索引:
“registrants_pkey”主键,btree(“用户”)
外键约束:
"registrants_country_fkey" FOREIGN KEY (country) REFERENCES countries(id)
"registrants_user_fkey" FOREIGN KEY ("user") REFERENCES users(id)
引用者:
TABLE "class_evaluations" CONSTRAINT "class_evaluations_registrant_fkey" FOREIGN KEY (registrant) REFERENCES registrants("user")
触发器:
archive_registrants 在删除或更新每行执行程序的注册人之前 archive_reg_table()
有 OID:没有