Discussion:
Limiting user access to a view only
(too old to reply)
Richard Colman
2004-05-04 19:12:58 UTC
Permalink
I am a novice in this area.

How would I set up a new user on PostgreSQL so that the new user is limited
to reading a particular view, and can do nothing else.

Help greatly appreciated.

Richard Colman
Institute for Genomics and Bioinformatics
949-824-1816, 701-5330
***@uci.edu


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Gaetano Mendola
2004-05-05 16:27:41 UTC
Permalink
Post by Richard Colman
I am a novice in this area.
How would I set up a new user on PostgreSQL so that the new user is limited
to reading a particular view, and can do nothing else.
Hi,
first of all create the user as no a super user, after use the
GRANT command
( http://www.postgresql.org/docs/7.4/interactive/sql-grant.html )


in your case:

GRANT SELECT ON <view_name> TO <user_name>



Regards
Gaetano Mendola
Jim Seymour
2004-05-05 15:56:25 UTC
Permalink
Post by Richard Colman
I am a novice in this area.
How would I set up a new user on PostgreSQL so that the new user is limited
to reading a particular view, and can do nothing else.
Help greatly appreciated.
You will find these handy, no doubt...

http://www.postgresql.org/docs/7.4/static/tutorial.html
http://www.postgresql.org/docs/7.4/static/sql-createuser.html
http://www.postgresql.org/docs/7.4/static/sql-grant.html

Jim


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)
Peter Eisentraut
2004-05-05 17:10:26 UTC
Permalink
Post by Richard Colman
How would I set up a new user on PostgreSQL so that the new user is
limited to reading a particular view, and can do nothing else.
A new user normally can't do anything. Just grant the privileges on the
view to him. You may also want to revoke all permissions on databases
and schemas, some of which are set to allow everything by default. The
GRANT manual page contains more information and pointers.



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Loading...