mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +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:
@ -3566,6 +3566,8 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
||||
(List *) cmd->def, lockmode);
|
||||
break;
|
||||
case AT_ChangeOwner: /* ALTER OWNER */
|
||||
check_rolespec_name(cmd->newowner,
|
||||
"Cannot specify reserved role as owner.");
|
||||
ATExecChangeOwner(RelationGetRelid(rel),
|
||||
get_rolespec_oid(cmd->newowner, false),
|
||||
false, lockmode);
|
||||
|
Reference in New Issue
Block a user