Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tender Wang <tndrwang@gmail.com>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-08-07T18:50:50Z
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/
Commits
-
Restructure foreign key handling code for ATTACH/DETACH
- d20194cead75 13.17 landed
- 5d83bad6b87d 15.9 landed
- 5914a22f6ea5 17.1 landed
- 53af9491a043 18.0 landed
- 46a8c27a7226 14.14 landed
- 2aaf2a28b87e 16.5 landed
-
Refuse ATTACH of a table referenced by a foreign key
- e97121d90e91 14.14 landed
- ada34d7146c3 16.5 landed
- a90bdd7a44d0 18.0 landed
- 8c0944ac878d 15.9 landed
- 344f9f5e2b18 17.0 landed
- 2ee02c98dd17 13.17 landed
- 17ed92e1ff60 12.21 landed