Re: How to limit access only to certain records? - Mailing list pgsql-sql

From hari.fuchs@gmail.com
Subject Re: How to limit access only to certain records?
Date
Msg-id 87r4t78klo.fsf@hf.protecting.net
Whole thread Raw
In response to How to limit access only to certain records?  (Andreas <maps.on@gmx.net>)
List pgsql-sql
Andreas <maps.on@gmx.net> writes:

> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?

Maybe something like the following:

CREATE TABLE test1 ( id serial NOT NULL, val text NOT NULL, _user text NOT NULL, PRIMARY KEY (id)
);

COPY test1 (val, _user) FROM stdin;
for user1#1    user1
for user1#2    user1
for user2#1    user2
\.

CREATE VIEW test1v AS
SELECT id, val
FROM test1
WHERE _user = current_user;



pgsql-sql by date:

Previous
From: Jayadevan M
Date:
Subject: Re: How to limit access only to certain records?
Next
From: Craig Ringer
Date:
Subject: Re: How to limit access only to certain records?