Re: alter user/role CURRENT_USER - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: alter user/role CURRENT_USER
Date
Msg-id 20150306225753.GI3291@alvh.no-ip.org
Whole thread Raw
In response to Re: alter user/role CURRENT_USER  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: alter user/role CURRENT_USER
List pgsql-hackers
There is something odd here going on:

alvherre=# alter group test add user current_user;
ERROR:  role "test" is a member of role "(null)"

Surely (null) is not the right name to be reporting there ...

Attached is a rebased patch, which also has some incomplete doc changes.

With this patch applied, doing
\h ALTER ROLE
in psql looks quite odd: note how wide it has become.  Maybe we should
be doing this differently?  (Hmm, why don't we accept ALL in the first SET
line?  Maybe that's just a mistake and the four lines should be all
identical in the first half ...)


alvherre=# \h alter role
Command:     ALTER ROLE
Description: change a database role
Syntax:
ALTER ROLE { name | CURRENT_USER | SESSION_USER } [ WITH ] option [ ... ]

where option can be:

      SUPERUSER | NOSUPERUSER
    | CREATEDB | NOCREATEDB
    | CREATEROLE | NOCREATEROLE
    | CREATEUSER | NOCREATEUSER
    | INHERIT | NOINHERIT
    | LOGIN | NOLOGIN
    | REPLICATION | NOREPLICATION
    | BYPASSRLS | NOBYPASSRLS
    | CONNECTION LIMIT connlimit
    | [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
    | VALID UNTIL 'timestamp'

ALTER ROLE name RENAME TO new_name

ALTER ROLE { name | CURRENT_USER | SESSION_USER } [ IN DATABASE database_name ] SET configuration_parameter { TO | = }
{value | DEFAULT } 
ALTER ROLE { name | CURRENT_USER | SESSION_USER | ALL } [ IN DATABASE database_name ] SET configuration_parameter FROM
CURRENT
ALTER ROLE { name | CURRENT_USER | SESSION_USER | ALL } [ IN DATABASE database_name ] RESET configuration_parameter
ALTER ROLE { name | CURRENT_USER | SESSION_USER | ALL } [ IN DATABASE database_name ] RESET ALL

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Bootstrap DATA is a pita
Next
From: Bruce Momjian
Date:
Subject: Re: MD5 authentication needs help