Using the <@ Operator in PostgreSQL

In PostgreSQL, the <@ operator checks to see whether the second array contains the first array. That is, whether or not the array on the right of the operator contains all elements in the array to the left.

The function returns a Boolean result: It returns true if the second array contains the first array, and false if it doesn’t. If the result is unknown, it returns NULL.

Continue reading

How the @> Operator Works in PostgreSQL

In PostgreSQL, the @> operator checks to see whether the first array contains the second array. That is, whether or not the array on the left of the operator contains all elements in the array to the right.

The function returns a Boolean result: It returns true if the first array contains the second, and false if it doesn’t. If the result is unknown, it returns NULL.

Continue reading

A Quick Look at the && Operator in PostgreSQL

We can use the && operator in PostgreSQL to check two arrays for any overlapping elements.

We include an array on each side of the operator to compare them, and the result is a Boolean value that indicates whether or not there’s any overlap. A result of True (or t) indicates that there’s an overlap, while False (or f) indicates there’s no overlap.

Continue reading