| От | Arcady Genkin |
|---|---|
| Тема | Bitwise operators in SQL |
| Дата | |
| Msg-id | r1zk8358kts.fsf@gnu.cdf.toronto.edu обсуждение исходный текст |
| Ответы |
Re: Bitwise operators in SQL
|
| Список | pgsql-general |
I'm writing SQL code for dynamic page generation in PHP. I'd like to be able to determine whether a certain class of users has access to certain pages. I was thinking of doing it the usual way: set bitmasks, e.g. STUDENT=1, INSTRUCTOR=2, STAFF=4, etc., and store permissions from bitwise AND of applicable masks in the table that keeps info about each page. But the problem is that there are no bitwise operators among Postgres's supported operators. So, I cannot write something like select name from pages where access&2>0; Is there a standard way to approach this kind of problem? Many thanks, -- Arcady Genkin
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера