Re: DROP OWNED BY is broken on master branch.

From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: DROP OWNED BY is broken on master branch.
Date: 2022-09-27 06:52:50
Message-ID: CAGPqQf0fSMsdtq+w=hSa-2Px7rVQJhxEZWJhAc67qNHTX8p=wQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 26, 2022 at 11:46 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Mon, Sep 26, 2022 at 3:44 AM Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)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.
>

Yes, I was also thinking to avoid the duplicate logic but couldn't found
a way. I did the quick testing with the patch, and reported test is working
fine. But "make check" is failing with few failures.

> Per Michael's suggestion, I have also written a test case and included
> it in this version.
>

Thanks for this.

> Comments?
>
> --
> Robert Haas
> EDB: http://www.enterprisedb.com
>

--
Rushabh Lathia

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-09-27 07:21:05 Re: A doubt about a newly added errdetail
Previous Message Himanshu Upadhyaya 2022-09-27 06:40:01 Re: HOT chain validation in verify_heapam()