PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> A query using a right bit shift and an equality on a bit field seems to
> return incorrect results.
Ugh. bit_cmp expects that any unused bits in the last byte
are guaranteed zero, but bitshiftright isn't ensuring that.
Didn't look to see if the same bug exists anywhere else ...
regards, tom lane