From: | Darren Ferguson <darren(at)crystalballinc(dot)com> |
---|---|
To: | Harald Massa <HaraldMassa(at)ghum(dot)de> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Different views with same name for different users |
Date: | 2002-01-16 14:59:42 |
Message-ID: | Pine.LNX.4.10.10201160957520.26913-100000@thread.crystalballinc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Correct me if i am wrong which is normally the case :-))
But you could create the views as you have said then grant user access
permissions on them. I.e. get the priveldged user to create all the views
and then use the GRANT command to allow users to access them. I.e.
GRANT ALL ON PERS TO user D;
Hope this helps
Darren
Darren Ferguson
On Wed, 16 Jan 2002, Harald Massa wrote:
> 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
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Francisco Reyes | 2002-01-16 15:23:48 | Re: Turning off transactions completely. |
Previous Message | Holger Krug | 2002-01-16 14:50:28 | Re: Different views with same name for different users |