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.
  • If the string matches the pattern, the function returns TRUE.
  • If the string does not match the pattern, the function returns FALSE.
'abc' LIKE 'a%' t
not like Compares a string with a pattern.
  • If the string does not match the pattern, the function returns TRUE.
  • If the string matches the pattern, the function returns FALSE.
'abc' NOT LIKE 'c' t
similar to Compares a string with an SQL standard regular expression pattern.
  • If the string matches the pattern, the function returns TRUE.
  • If the string does not match the pattern, the function returns FALSE.
'abc' SIMILAR TO '%(b|d)%' t
not similar to Compares a string with an SQL standard regular expression pattern.
  • If the string does not match the pattern, the function returns TRUE.
  • If the string matches the pattern, the function returns FALSE.
'abc' NOT SIMILAR TO '(b|c)%' t
rlike ~ Compares a string with a regular expression pattern.
  • If the string matches the pattern, the function returns TRUE.
  • If the string does not match the pattern, the function returns FALSE.
Note

The match is case-sensitive.

'abc' ~ '(b|d)' t
rlike ! ~* Compares a string with a regular expression pattern.
  • If the string does not match the pattern, the function returns TRUE.
  • If the string matches the pattern, the function returns FALSE.
Note

The match is not case-sensitive.

'abc' ! ~* '(B|D)' f
rlike ~* Compares a string with a regular expression pattern.
  • If the string matches the pattern, the function returns TRUE.
  • If the string does not match the pattern, the function returns FALSE.
Note

The match is not case-sensitive.

'abc' ~* '(B|D)' t
rlike ! ~ Compares a string with a regular expression pattern.
  • If the string does not match the pattern, the function returns TRUE.
  • If the string matches the pattern, the function returns FALSE.
Note

The match is case-sensitive.

'abc' ! ~ '(b|d)' f