Reserved roles and user mapping - Mailing list pgsql-hackers

From Amit Langote
Subject Reserved roles and user mapping
Date
Msg-id 570E1C75.8060106@lab.ntt.co.jp
Whole thread Raw
Responses Re: Reserved roles and user mapping  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Hi,

Currently in CreateUserMapping():
   /* Additional check to protect reserved role names */   check_rolespec_name(stmt->user,
"Cannotspecify reserved role as mapping user.");
 

User mapping terminology is not that clear to me really but how does the
following sound as detail message:

"Cannot create mapping for reserved roles" or "Cannot create reserved role
mapping"

Also then, are checks for reserved role specification in
AlterUserMapping() and RemoveUserMapping() really necessary?
   /* Additional check to protect reserved role names */   check_rolespec_name(stmt->user,
"Cannotalter reserved role mapping user.");
 
   /* Additional check to protect reserved role names */   check_rolespec_name(stmt->user,
"Cannotremove reserved role mapping user.");
 

Messages output in those cases are:

ERROR:  role "pg_signal_backend" is reserved
DETAIL:  Cannot alter reserved role mapping user.

ERROR:  role "pg_signal_backend" is reserved
DETAIL:  Cannot remove reserved role mapping user.

Whereas, the following would seem more natural:

ERROR: user mapping "pg_signal_backend" does not exist for the server

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: [patch] \crosstabview documentation
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Pglogical questions and problems