Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

operator does not exist: bit & integer

I ran the following in psql to flip a bit:

select (b'11' & ~0)

but received this error

ERROR:  operator does not exist: bit & 
integer
LINE 1: select (b'11' & ~0);

What’s my mistake?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Ensure that both operands are of the same type, bit or integer. Here’s an example:

Using bit operands:

SELECT (B'11'::bit & ~B'0'::bit);

Using integer operands:

SELECT (3 & ~0);

Choose what is better suite for you

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading