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 22:22:39
Message-ID: 202408072222.icgykv5yrql5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2024-Jul-15, Tender Wang wrote:

> PG Bug reporting form <noreply(at)postgresql(dot)org> 于2024年7月15日周一 21:02写道:

> > The following script:
> > CREATE TABLE t1 (a int, PRIMARY KEY (a));
> > CREATE TABLE t (a int, PRIMARY KEY (a), FOREIGN KEY (a) REFERENCES t1)
> > PARTITION BY LIST (a);
> > ALTER TABLE t ATTACH PARTITION t1 FOR VALUES IN (1);

I propose to reject this with the attached patch, which I intend to
backpatch all the way down to 12.

FWIW, it's not the same problem that Jehan-Guillaume described in [1],
even though the error message being thrown is the same.

[1] https://postgr.es/m/20230705233028.2f554f73@karst

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

Attachment Content-Type Size
0001-Refuse-ATTACH-of-a-table-referenced-by-a-foreign-key.patch text/x-diff 4.7 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2024-08-08 02:35:11 Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Previous Message Alvaro Herrera 2024-08-07 18:50:50 Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error