mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Reserve the "pg_" namespace for roles
This will prevent users from creating roles which begin with "pg_" and will check for those roles before allowing an upgrade using pg_upgrade. This will allow for default roles to be provided at initdb time. Reviews by José Luis Tallón and Robert Haas
This commit is contained in:
@ -176,8 +176,13 @@ policy_role_list_to_array(List *roles, int *num_roles)
|
||||
return role_oids;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Additional check to protect reserved role names */
|
||||
check_rolespec_name((Node *) spec,
|
||||
"Cannot specify reserved role as policy target");
|
||||
role_oids[i++] =
|
||||
ObjectIdGetDatum(get_rolespec_oid((Node *) spec, false));
|
||||
}
|
||||
}
|
||||
|
||||
return role_oids;
|
||||
|
Reference in New Issue
Block a user