test=# select aa from t1 where dd like '%我%'; ERROR: operator does not exist: text[] ~~ "unknown" 提示: No operator matches the given name and argument type(s). You may need to add explicit type casts.
解决了,原来text字段属于数组查询,得dd[1]这样来弄
可是我又遇到了新问题: test=# select * from t1 where dd[1] like '可以'; ERROR: invalid byte sequence for encoding "UNICODE": 0xd4 test=# select * from t1 where dd[1] like '我'; aa | bb | cc | dd ----+----+----+---- (0 行) 这是为啥啊?该怎么解决?解决了马上散分!!!
ERROR: operator does not exist: text[] ~~ "unknown"
提示: No operator matches the given name and argument type(s). You may need to
add explicit type casts.
test=# select * from t1 where dd[1] like '可以';
ERROR: invalid byte sequence for encoding "UNICODE": 0xd4
test=# select * from t1 where dd[1] like '我';
aa | bb | cc | dd
----+----+----+----
(0 行)
这是为啥啊?该怎么解决?解决了马上散分!!!
我的pgsql就没什么问题。不过我的数据库编码是EUC_CN.
test=# \encoding GBK
运行一下看看