Обсуждение: Limiting user access to a view only
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 colman@uci.edu
Richard Colman wrote: > 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
> > 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
Richard Colman wrote: > 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.