Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
Date: 2024-08-07 18:50:50
Message-ID: 202408071850.g7wjetpfbloe@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2024-Aug-07, Alvaro Herrera wrote:

> I think this schema is nuts. Do you have a practical use for something
> like this?

FWIW if you try to set this up the other way around, you get a different
error:

create table t (a int primary key) partition by list (a);
create table t1 partition of t for values in (1);
alter table t add foreign key (a) references t1;
ERROR: cannot ALTER TABLE "t1" because it is being used by active queries in this session

so I'm not bothered by the restriction in functionality.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2024-08-07 22:22:39 Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
Previous Message Alvaro Herrera 2024-08-07 18:44:55 Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error