Extending Operators
PostgreSQL uses operators as the method by which data comparisons or aggregations are done. There are three general classes of PostgreSQL operators: left unary, right unary, and binary.
Binary operators are perhaps the most common. In essence, an operator is binary when it will sit between two separate data types (for example, 21 > 20). A classic example of a binary data type is the greater-than symbol (>); it sits between two data elements and returns a Boolean value from the evaluation of each element. Even more basic is the addition operator (+), which sums the values on each side and returns a result (for example, 2 + 3 returns 5).
Unary operators only accept data from one side, hence the names left unary or right unary. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access