How do i extract a certain bit from a bigint column

Поиск
Список
Период
Сортировка
От Mats Sjöberg
Тема How do i extract a certain bit from a bigint column
Дата
Msg-id A40C30932F52C4409B89ED049CCA06B13BA41D@srvex01.hk.cybernetics.se
обсуждение исходный текст
Ответы Re: How do i extract a certain bit from a bigint column  (Mike Rylander <miker@purplefrog.com>)
Re: How do i extract a certain bit from a bigint column  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql

Hello everyone

In a table i have a column status of type bigint.

I need to create a view of the table including all rows with bit 4 set (value 8).

At the same time i need to exclude excludig all rows with bit 2 set.

 

What is the syntax to extract those bits?

I have tested get_bit(string, offset) but this requires a string, and not a bigint.

Is there a function to

Best regards, Mats

 

Вложения

В списке pgsql-sql по дате отправления:

Предыдущее
От: "William Anthony Lim"
Дата:
Сообщение: Re: working with schema
Следующее
От: Mike Rylander
Дата:
Сообщение: Re: How do i extract a certain bit from a bigint column