mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Fix changing the ownership of ALL TABLES IN SCHEMA publication.
Ensure that the new owner of ALL TABLES IN SCHEMA publication must be a superuser. The same is already ensured during CREATE PUBLICATION. Author: Vignesh C Reviewed-by: Nathan Bossart, Greg Nancarrow, Michael Paquier, Haiying Tang Discussion: https://postgr.es/m/CALDaNm0E5U-RqxFuFrkZrQeG7ae5trGa=xs=iRtPPHULtT4zOw@mail.gmail.com
This commit is contained in:
@@ -1192,6 +1192,13 @@ AlterPublicationOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
|
||||
errmsg("permission denied to change owner of publication \"%s\"",
|
||||
NameStr(form->pubname)),
|
||||
errhint("The owner of a FOR ALL TABLES publication must be a superuser.")));
|
||||
|
||||
if (!superuser_arg(newOwnerId) && is_schema_publication(form->oid))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("permission denied to change owner of publication \"%s\"",
|
||||
NameStr(form->pubname)),
|
||||
errhint("The owner of a FOR ALL TABLES IN SCHEMA publication must be a superuser.")));
|
||||
}
|
||||
|
||||
form->pubowner = newOwnerId;
|
||||
|
Reference in New Issue
Block a user