Different views with same name for different users

Поиск
Список
Период
Сортировка
От Harald Massa
Тема Different views with same name for different users
Дата
Msg-id 005201c19e99$51f685a0$0100a8c0@tog2
обсуждение исходный текст
Ответы Re: Different views with same name for different users  (Holger Krug <hkrug@rationalizer.com>)
Re: Different views with same name for different users  (Darren Ferguson <darren@crystalballinc.com>)
Список pgsql-general
Hello,

i've got a table of around 10.000 records.

Users A, B, C are allowed to see all the records

user D only some
user E only some others

To take logic away from the application to the database,
I would like to have a view as

for user D:
CREATE VIEW PERS as SELECT * FROM TOTALDATABASE where (criteria for viewable
user D)

for user E:
CREATE VIEW PERS as SELECT * FROM TOTALDATABASE where (criteria for viewable
user E)

for users A, B, C
CREATE VIEW PERS as SELECT * FROM TOTALDATABASE

so in my application I can do alll the SELECTS on PERS ... which looks
different for every user.

Which is the most elegant way to do this?
(is there any way at all????)

Tnx

Harald




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

Предыдущее
От: jboes@nexcerpt.com (Jeff Boes)
Дата:
Сообщение: Re: CHECK constraint so that only one is TRUE?
Следующее
От: "Esger Abbink"
Дата:
Сообщение: oid problem with dumping database (failed sanity check, opr with oid 280515 was not found)