Re: grant the right to select only certain rows? - Mailing list pgsql-general

From Fran Fabrizio
Subject Re: grant the right to select only certain rows?
Date
Msg-id 3C51A5E9.76AD9EC5@mmrd.com
Whole thread Raw
In response to Re: grant the right to select only certain rows?  (Jan Wieck <janwieck@yahoo.com>)
List pgsql-general
>     But you could setup a second table teachers:
>
>         name          grade
>         -------------------
>         mary_smith    1
>         tom_white     2
>
>     and then use a view
>
>         CREATE VIEW my_students AS SELECT S.name, S.grade_level
>             FROM students S, teachers T
>             WHERE T.name = CURRENT_USER AND T.grade = S.grade_level;
>
>     Now  the  teachers don't need SELECT permissions on students,
>     but only on my_students. Mary can only see Joe and  Kim,  and
>     Tom can only see Lisa and Mike.

Ahh...this was the missing link in my head.  A way to make one view
customize itself to serve all users.

Thank you!

-Fran



pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: grant the right to select only certain rows?
Next
From: Fran Fabrizio
Date:
Subject: Re: grant the right to select only certain rows?