In article <20101022161331(dot)GD9770(at)frohike(dot)homeunix(dot)org>,
Peter Bex <Peter(dot)Bex(at)xs4all(dot)nl> writes:
> As far as I can see, this would imply either creating views on the
> <whatever> for every user (or company?), or manually crafting queries
> to do the same.
Not necessarily. Consider this:
CREATE TABLE t1 (
id serial NOT NULL,
val int NOT NULL,
usr text NOT NULL,
PRIMARY KEY (id)
);
COPY t1 (val, usr) FROM stdin;
1 u1
2 u1
3 u2
4 u3
\.
CREATE VIEW t1v (id, val) AS
SELECT id, val
FROM t1
WHERE usr = current_user;
Now user "u1" can only see rows 1 and 2.