Re: granting permission to groups? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: granting permission to groups?
Date
Msg-id Pine.LNX.4.21.0004102342100.460-100000@localhost.localdomain
Whole thread Raw
In response to Re: granting permission to groups?  ("Frank P. Miles" <fpmi@home.com>)
List pgsql-general
Frank P. Miles writes:

> Sorry for my lack of specificity.  Using the syntax in the 'GRANT'
> section of the Postgresql manual, I inserted a group into pg_group,
> then created users within that group, then granted SELECT permissions
> for the group. There were no error messages; these steps appeared to
> work properly. Unfortunately, users are still unable to do SELECTs,
> though they are able to do a 'psql database-name', and list the
> tables.

Let's see ...

peter=# create user unpriv;
CREATE USER
peter=# create table test (a int);
CREATE
peter=# \c - unpriv
You are now connected as new user unpriv.
peter=> select * from test;
ERROR:  test: Permission denied.
peter=> \c - peter
You are now connected as new user peter.
peter=# create group testgrp with user unpriv;
CREATE GROUP
peter=# grant select on test to group testgrp;
CHANGE
peter=# \c - unpriv
You are now connected as new user unpriv.
peter=> select * from test;
 a
---
(0 rows)


Looks okay.

The permission checking code didn't change (to my knowledge) since 6.5, so
yes, it should work. If it still doesn't work for you I'd need to see
pg_users, pg_group and the output of \d and \z in psql.


--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Features
Next
From: "Oscar"
Date:
Subject: Search problem