Different views with same name for different users

From: "Harald Armin Massa" <ghum(at)gmx(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Different views with same name for different users
Date: 2002-01-15 23:03:25
Message-ID: 00c701c19e18$d6ca4b30$0100a8c0@tog2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Dave Trombley 2002-01-15 23:12:52 User defined types and storage variance
Previous Message Tom Lane 2002-01-15 22:38:42 Re: User defined types and storage variance