Re: Grant select on view

From: thiemo <thiemo(at)gmx(dot)ch>
To: pgNovice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Grant select on view
Date: 2002-04-01 08:22:39
Message-ID: A147FE42-4549-11D6-BA58-000A27D62F9E@gmx.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-04-01 15:14:42 Re: Grant select on view
Previous Message Tom Lane 2002-03-31 15:18:08 Re: Grant select on view