问题
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