<excerpt>A complete example; we can't possibly guess what you did
wrong with
only such sketchy details. It would also be useful to know which
version of PG you are using.
</excerpt>
Oh, sure. A self-compiled 7.2, without any source code modifications.
I first instal a sequence:
"CREATE SEQUENCE seq
INCREMENT 1
MINVALUE 1
START 1
CACHE 1"
then a table:
"CREATE TABLE base (
att1 type(x) default nextval(seq),
...
attn type(x)
)"
a view:
"CREATE VIEW vie AS
SELECT att2, ..., attn_1
FROM base
WHERE attn = CURRENT_USER::varchar"
a user:
"CREATE USER usr PASSWORD 'somewhat'
NOCREATEDB
NOCREATEUSER"
and finally the grant:
"GRANT SELECT ON vie TO usr"
Hope this helps. Thx
Thiemo
<fontfamily><param>Helvetica</param>
--
Thiemo Kellner
Tösstalstrasse 146
CH-8400 Winterthur
</fontfamily>> A complete example; we can't possibly guess what you did wrong with
> only such sketchy details. It would also be useful to know which
> version of PG you are using.
Oh, sure. A self-compiled 7.2, without any source code modifications. I
first instal a sequence:
"CREATE SEQUENCE seq
INCREMENT 1
MINVALUE 1
START 1
CACHE 1"
then a table:
"CREATE TABLE base (
att1 type(x) default nextval(seq),
...
attn type(x)
)"
a view:
"CREATE VIEW vie AS
SELECT att2, ..., attn_1
FROM base
WHERE attn = CURRENT_USER::varchar"
a user:
"CREATE USER usr PASSWORD 'somewhat'
NOCREATEDB
NOCREATEUSER"
and finally the grant:
"GRANT SELECT ON vie TO usr"
Hope this helps. Thx
Thiemo
--
Thiemo Kellner
Tösstalstrasse 146
CH-8400 Winterthur