>>>>> "PdS" == Paulo da Silva <[EMAIL PROTECTED]> writes:

 PdS> Hello,
 PdS> I'm evaluating sql/postgresql for the following purpose:
 PdS> I need to have a database with lots of "records".
 PdS> I need to allow groups of users to access sets of
 PdS> those records grouped by the contents of one field.
 PdS> For example, the group A can only access records that
 PdS> have the dptm field = "A". Is this possible?

 PdS> If the subject is not simple, pls just tell me
 PdS> which doc to read.

Suppose you have table:

create table a (
  tag int,
  info text
);

and you want controll user's depend on the 'tag' field value. I think
you can do following:

create view v1 as select info from a where tag = 1;
create view v2 as select info from a where tag = 2;
create view v3 as select info from a where tag = 3;

revoke all on a from public;

grant select on v1 to user1, user2...;
grant select on v2 to group gr1, ...;
. . .
  

-- 
Anatoly K. Lasareff              Email:       [EMAIL PROTECTED] 
Senior programmer

Reply via email to