Postgres match operator @@

▼魔方 西西 提交于 2019-12-11 16:34:50

问题


I'm trying to figure out how exactly does @@ operator work in postgres.

I have the two queries:

SELECT description FROM product WHERE description @@ '%apple%'
SELECT description FROM product WHERE description @@ 'apple'

The two queries return the same number of rows. Apparently postgres removes all non alfanumeric characters from the query. Is this actually the case?

I can also do @@ '@apple..,,.' and I still get the same number of results.


回答1:


@@ operator is part of TSearch2 Full Text Search Engine. It does remove such characters, by default. The topic of TSearch2 is way too big to include it all here, so I'll just point you to documentation.



来源:https://stackoverflow.com/questions/14835866/postgres-match-operator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!