Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2025-05-08 Thread Alvaro Herrera
On 2025-May-08, Matthew Gabeler-Lee wrote: > My earlier test case, and an adjusted version of it that is closer to > my production application (notably adding ON DELETE CASCADE to the > FK), now passes with 15.13. Thank you, that's a relief to know. -- Álvaro Herrera PostgreSQL Develope

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2025-05-08 Thread Matthew Gabeler-Lee
On Sat, May 3, 2025 at 9:09 AM Alvaro Herrera wrote: > Y'all are still on time to test this a bit more before next week's > releases ... if I have made things even worse I can still revert the > patch. With luck, that won't be necessary. I was not able to get to testing this before the release,

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2025-05-03 Thread Alvaro Herrera
On 2025-May-01, Tender Wang wrote: > Hmm. I didn't get the same conclusion. > Before commit 5914a22f6ea5, the issue reported by Luca could have happened. [...] > You can see from the above test that no error was reported. > But if I revert the commit 614a406b4ff1, above test would report error o

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2025-05-02 Thread Tender Wang
Alvaro Herrera 于2025年5月1日周四 20:17写道: > Hello, > > I've been looking at this bug once again and I think I finally > understood what's going on and how to fix it. > > Ref 1: https://postgr.es/m/20230707175859.17c91538@karst > Re: Issue attaching a table

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2025-05-01 Thread Alvaro Herrera
Hello, I've been looking at this bug once again and I think I finally understood what's going on and how to fix it. Ref 1: https://postgr.es/m/20230707175859.17c91538@karst Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2023-07-07 Thread Jehan-Guillaume de Rorthais
So I gave a look at this one... And it's a tricky one. The current policy about DETACHing a partition is to keep/adjust all FK referencing it or referenced by it. However, in this exact self-referencing usecase, we can have rows referencing rows from the same partition OR another one. It seems li

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2023-03-22 Thread Guillaume Lelarge
One last ping, hoping someone will have more time now than in january. Perhaps my test is wrong, but I'd like to know why. Thanks. Le mar. 17 janv. 2023 à 16:53, Guillaume Lelarge a écrit : > Quick ping, just to make sure someone can get a look at this issue :) > Thanks. > > > Le ven. 6 janv.

Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key

2023-01-17 Thread Guillaume Lelarge
Quick ping, just to make sure someone can get a look at this issue :) Thanks. Le ven. 6 janv. 2023 à 11:07, Guillaume Lelarge a écrit : > Hello, > > One of our customers has an issue with partitions and foreign keys. He > works on a v13, but the issue is also present on v15. > > I attach a SQL

Issue attaching a table to a partitioned table with an auto-referenced foreign key

2023-01-06 Thread Guillaume Lelarge
Hello, One of our customers has an issue with partitions and foreign keys. He works on a v13, but the issue is also present on v15. I attach a SQL script showing the issue, and the results on 13.7, 13.9, and 15.1. But I'll explain the script here, and its behaviour on 13.9. There is one partitio