This page in other versions: Unsupported versions: 7.0

General Operators

The operators listed here are defined for a number of native data types, ranging from numeric types to data/time types.

Table 4-2. Postgres Operators

Operator Description Usage
< Less than? 1 < 2
<= Less than or equal to? 1 <= 2
<> Not equal? 1 <> 2
= Equal? 1 = 1
> Greater than? 2 > 1
>= Greater than or equal to? 2 >= 1
|| Concatenate strings 'Postgre' || 'SQL'
!!= NOT IN 3 !!= i
~~ LIKE 'scrappy,marc,hermit' ~~ '%scrappy%'
!~~ NOT LIKE 'bruce' !~~ '%al%'
~ Match (regex), case sensitive 'thomas' ~ '.*thomas.*'
~* Match (regex), case insensitive 'thomas' ~* '.*Thomas.*'
!~ Does not match (regex), case sensitive 'thomas' !~ '.*Thomas.*'
!~* Does not match (regex), case insensitive 'thomas' !~* '.*vadim.*'

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Privacy Policy | About PostgreSQL
Copyright © 1996-2016 The PostgreSQL Global Development Group