• Alvaro Herrera's avatar
    Allow CURRENT/SESSION_USER to be used in certain commands · 31eae602
    Alvaro Herrera authored
    Commands such as ALTER USER, ALTER GROUP, ALTER ROLE, GRANT, and the
    various ALTER OBJECT / OWNER TO, as well as ad-hoc clauses related to
    roles such as the AUTHORIZATION clause of CREATE SCHEMA, the FOR clause
    of CREATE USER MAPPING, and the FOR ROLE clause of ALTER DEFAULT
    PRIVILEGES can now take the keywords CURRENT_USER and SESSION_USER as
    user specifiers in place of an explicit user name.
    
    This commit also fixes some quite ugly handling of special standards-
    mandated syntax in CREATE USER MAPPING, which in particular would fail
    to work in presence of a role named "current_user".
    
    The special role specifiers PUBLIC and NONE also have more consistent
    handling now.
    
    Also take the opportunity to add location tracking to user specifiers.
    
    Authors: Kyotaro Horiguchi.  Heavily reworked by Álvaro Herrera.
    Reviewed by: Rushabh Lathia, Adam Brightwell, Marti Raudsepp.
    31eae602
create_schema.sgml 7.46 KB