Compatible with PostgreSQL, Hologres allows you to use standard PostgreSQL syntax for data development.
The following table describes the pattern matching functions supported by Hologres. The functions supported by Hologres are only a subset of the PostgreSQL functions. For more information about how to use these functions, see Pattern Matching in the PostgreSQL documentation.
Function | Description | Example | Result |
like | Compares a string with a pattern.
|
'abc' LIKE 'a%' | t |
not like | Compares a string with a pattern.
|
'abc' NOT LIKE 'c' | t |
similar to | Compares a string with an SQL standard regular expression pattern.
|
'abc' SIMILAR TO '%(b|d)%' | t |
not similar to | Compares a string with an SQL standard regular expression pattern.
|
'abc' NOT SIMILAR TO '(b|c)%' | t |
rlike ~ | Compares a string with a regular expression pattern.
Note The match is case-sensitive. |
'abc' ~ '(b|d)' | t |
rlike ! ~* | Compares a string with a regular expression pattern.
Note The match is not case-sensitive. |
'abc' ! ~* '(B|D)' | f |
rlike ~* | Compares a string with a regular expression pattern.
Note The match is not case-sensitive. |
'abc' ~* '(B|D)' | t |
rlike ! ~ | Compares a string with a regular expression pattern.
Note The match is case-sensitive. |
'abc' ! ~ '(b|d)' | f |