Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error - Mailing list pgsql-bugs

From Tender Wang
Subject Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
Date
Msg-id CAHewXNn9osbWTFqoKRz8tHt8xn-vdkiWDanFkekE6-WSV3Ga9Q@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
List pgsql-bugs


Alvaro Herrera <alvherre@alvh.no-ip.org> 于2024年8月8日周四 06:22写道:
On 2024-Jul-15, Tender Wang wrote:

> PG Bug reporting form <noreply@postgresql.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.

Thanks for explanation. The attached patch looks good to me. 


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



--
Tender Wang

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #18575: Sometimes pg_rewind mistakenly assumes that nothing needs to be done.
Next
From: Tom Lane
Date:
Subject: Re: BUG #18573: Analyze command consumes several GB of memory - more than analyzed table size