postgres.git / summary / log / commit / refs

commit    fe3b5eb08a16c391478e305bd9ea40f4f5979689
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Wed Oct 03 15:22:41 2012 +0000
First released in: 9.3.0, 8.3.22, 8.4.15, 9.0.11, 9.1.7, 9.2.2

    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.


src/backend/catalog/pg_shdepend.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c index 5a73b48ea76..55637175356 100644 --- a/src/backend/catalog/pg_shdepend.c +++ b/src/backend/catalog/pg_shdepend.c @@ -1217,8 +1217,12 @@ shdepDropOwned(List *roleids, DropBehavior behavior) Form_pg_shdepend sdepForm = (Form_pg_shdepend) GETSTRUCT(tuple); ObjectAddress obj; - /* 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) [parent: e1be1df51fac]