Andreas <[email protected]> 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;


-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to