2014-02-21 190 views

回答

10

从PostgreSQL文档的9.7.1. LIKE

操作~~相当于LIKE,和~~*对应于ILIKE。还有!~~!~~*运营商,分别代表NOT LIKENOT ILIKE所有这些运算符都是特定于PostgreSQL的。

4

它没有列在index of the documentation这令人沮丧。

所以我有psql一看:

regress=> \do ~~ 
            List of operators 
    Schema | Name | Left arg type | Right arg type | Result type |  Description  
------------+------+---------------+----------------+-------------+------------------------- 
pg_catalog | ~~ | bytea   | bytea   | boolean  | matches LIKE expression 
pg_catalog | ~~ | character  | text   | boolean  | matches LIKE expression 
pg_catalog | ~~ | name   | text   | boolean  | matches LIKE expression 
pg_catalog | ~~ | text   | text   | boolean  | matches LIKE expression 
(4 rows) 

这对LIKE操作别名,仅此而已。