roles question

From: Joe Conway <mail(at)joeconway(dot)com>
To: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: roles question
Date: 2005-07-09 18:59:36
Message-ID: 42D01E98.70606@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

After months of being unable to keep up with what's going on here, I'm
trying to educate myself on some of the latest developments. I was
playing with roles a bit, and I don't know if I'm doing something wrong,
or if I found a hole:

works fine:
regression=# create role testrole2 with user testuser;
CREATE ROLE

doesn't work:
regression=# alter role testrole with user testuser;
ERROR: option "rolemembers" not recognized

works fine:
regression=# alter group testrole add user testuser;
ALTER ROLE

doesn't work (no surprise, is a syntax error):
regression=# alter role testrole add user testuser;
ERROR: syntax error at or near "add" at character 21
LINE 1: alter role testrole add user testuser;

It seems I can create a role with a user, and I can use ALTER GROUP
syntax to add a user to a role, but I can't figure out how to add a user
to a role using ALTER ROLE.

Similarly, these might be just plain abuse of the new syntax, but appear
to be allowed by gram.y:

regression=# alter user testuser in role testrole;
ERROR: option "addroleto" not recognized
regression=# alter user testuser in group testrole;
ERROR: option "addroleto" not recognized

Thanks,

Joe

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2005-07-09 19:13:08 Re: roles question
Previous Message Tom Lane 2005-07-09 15:48:35 Re: Must be owner to truncate?