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 B5E2328B-7759-4EF9-9541-256F955C8895@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 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.

After considering your approach a bit more, I started to think that what you propose might be a better option for
masterbranch. 

While looking up into pg_subscription is much easier to backpatch, making dbid real in pg_shdepend might be more future
proof.
But there might be some consequences that I do not understand now.


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Alexander Law
Date:
Subject: Re: Typos in the code and README
Next
From: Masahiko Sawada
Date:
Subject: Re: Support getrandom() for pg_strong_random() source