Re: DROP OWNED BY is broken on master branch.
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-26T18:16:45Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-bug-in-DROP-OWNED-BY.patch (application/octet-stream) patch 0001
On Mon, Sep 26, 2022 at 3:44 AM Rushabh Lathia <rushabh.lathia@gmail.com> wrote: > Commit 6566133c5f52771198aca07ed18f84519fac1be7 ensure that > pg_auth_members.grantor is always valid. This commit did changes > into shdepDropOwned() function and combined the SHARED_DEPENDENCY_ACL > and SHARED_DEPENDENCY_OWNER. In that process it removed condition for > local object in owner dependency. > > case SHARED_DEPENDENCY_OWNER: > - /* If a local object, save it for deletion below */ > - if (sdepForm->dbid == MyDatabaseId) > + /* Save it for deletion below */ > > Case ending up with above error because of the above removed condition. > > Please find the attached patch which fixes the case. Thanks for the report. I think it would be preferable not to duplicate the logic as your version does, though, so here's a slightly different version that avoids that. Per Michael's suggestion, I have also written a test case and included it in this version. Comments? -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Fix bug in DROP OWNED BY.
- 7188b9b0fdbb 16.0 landed
-
Ensure that pg_auth_members.grantor is always valid.
- 6566133c5f52 16.0 cited