Re: REASSIGN OWNED BY alters objects in other database. - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: REASSIGN OWNED BY alters objects in other database.
Date
Msg-id A8467D9A-11F1-49B5-8695-ED694B07601E@yandex-team.ru
Whole thread Raw
In response to Re: REASSIGN OWNED BY alters objects in other database.  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers

> On 1 Jan 2026, at 21:51, Álvaro Herrera <alvherre@kurilemu.de> wrote:
>
> <0001-REASSIGN-OWNED-ignore-subscriptions-in-other-databas.patch>

I've took a look into that patch and it seems correct to me.

> On 2 Jan 2026, at 01:41, Kirill Reshke <reshkekirill@gmail.com> wrote:
>
> I can see that REASSIGN owned will behave the way I want if the `dbid`
> column in pg_shdepend would be non-zero for record with deptype = 'o'
> (owner).
> This would automatically drop only subscriptions from the current
> database. But we create this record with dbid = 0 because of
> shdepAddDependency, which thinks that classId is a shared relation
> then dependency should have dbid = 0. I wonder if this is correct (for
> subscriptions case).
>
> If it is, then your patch WFM LGTM.

I would be nice to add a regression test.

Also, Álvaro correctly stated in commit message that same fix is needed for shdepDropOwned().
And, maybe, let's consider missing_ok parameter for API consistency in get_subscription_database()?


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: "Devanga.Susmitha@fujitsu.com"
Date:
Subject: Re: [PATCH] CRC32C optimizations using SVE2 on ARM.
Next
From: David Rowley
Date:
Subject: Re: Fix outdated comments in catcache.h