From: Alvaro Herrera Date: Wed, 3 Oct 2012 15:22:41 +0000 (-0300) Subject: REASSIGN OWNED: consider grants on tablespaces, too X-Git-Tag: REL8_3_22~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a36a724f8032ee5abd008956d2c2495fb57a656;p=thirdparty%2Fpostgresql.git REASSIGN OWNED: consider grants on tablespaces, too Apparently this was considered in the original code (see commit cec3b0a9) but I failed to notice that such entries would always be skipped by the database check at the start of the loop. Per bugs #7578 by Nikolay, #6116 by tushar.qa@gmail.com. --- diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c index 2420a9855fd..6f4d52c1730 100644 --- a/src/backend/catalog/pg_shdepend.c +++ b/src/backend/catalog/pg_shdepend.c @@ -1166,8 +1166,12 @@ shdepDropOwned(List *roleids, DropBehavior behavior) InternalGrant istmt; Form_pg_shdepend sdepForm = (Form_pg_shdepend) GETSTRUCT(tuple); - /* We only operate on objects in the current database */ - if (sdepForm->dbid != MyDatabaseId) + /* + * We only operate on shared objects and objects in the current + * database + */ + if (sdepForm->dbid != MyDatabaseId && + sdepForm->dbid != InvalidOid) continue; switch (sdepForm->deptype)