很麻烦,PostgreSQL不支持integer到boolean的转换
如数据库test拥有字段
banned boolean
使用命令
insert into test(banned) values (0)
返回为
ERROR: column “banned” is of type boolean but expression is of type integer
LINE 1: insert into test(banned) values(0)
很是不方便。用cast也没用
难到只能用规定的 TRUE,’t',’true’,'y’,'yes’,’1′吗?
但奇怪的是select 0::boolean支能显示false
分类: PostgreSQL
近期评论