~~ Postgres statement

I have a request in Postgres :

SELECT DISTINCT a.profn FROM tprof a, sap_tstc b, tgrc c WHERE ((c.grcid ~~ a.grcid) AND ((c.tcode) = (b.tcode))); 

What does ~~ mean?

+6
source share
2 answers

From 9.7.1. LIKE PostgreSQL documentation:

The operator ~~ equivalent to LIKE , and ~~* corresponds to ILIKE . There are also operators !~~ and !~~* , which represent NOT LIKE and NOT ILIKE respectively. All of these statements are specific to PostgreSQL.

+10
source

It is not listed in the documentation index , which is disappointing.

So, I looked with 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) 

This is an alias operator for LIKE , that's all.

+4
source

All Articles