2014-02-21 189 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操作別名,僅此而已。