I tried using the & operator as an AND operator but it did not work

Does this just not work on bit.io or have I misunderstood what does and doesn’t work in postgresql?

The | operator works as an OR in pattern matching i.e. SIMILAR TO ‘%(0|1|2|3|4|5|6|7|8|9)%’ looks for digits in a string but & didn’t work i.e. SIMILAR TO ‘%(1&2)%’ didn’t find strings containing 1 and 2.

Neither work in a WHERE clause.

Hi there!

bit.io is fully postgresql compliant. So any pattern matching that works with vanilla postgres should work with bit.io.

Have you reviewed the postgres pattern matching docs? It looks like & is not an operator compatible with SIMILAR TO or LIKE as per the postgres spec.

After reviewing the postgres select docs, I believe that you are correct in that WHERE does not support pattern matching.

1 Like