Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-30 Thread Paul Foerster
Hi Alvaro, > On 30 Nov 2024, at 08:41, Alvaro Herrera wrote: > > Only if you have self-referencing FKs in partitioned tables. It > would be an interesting data point to verify whether this reports > anything else. Also, I'd be really curious if your databases include > the case I'm suspicious

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-29 Thread Alvaro Herrera
Hello, On 2024-Nov-29, Paul Foerster wrote: > > On 29 Nov 2024, at 18:15, Alvaro Herrera wrote: > > This reports case 2 as OK and case 1 as bogus, as should be. I tried > > adding more partitions and this seems to hold correctly. I was afraid > > though that this would fail if we create an FK

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-29 Thread Paul Foerster
Hi Alvaro, > On 29 Nov 2024, at 18:15, Alvaro Herrera wrote: > > This all was to say that the query in the release notes is undoubtedly > wrong. After thinking some more about it, I think the fix is to add 1 > to the number of constraints: > > SELECT conrelid::pg_catalog.regclass AS "constrain

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-29 Thread Alvaro Herrera
On 2024-Nov-27, Tom Lane wrote: > I doubt that there's anything actually wrong with the catalog state at > this point (perhaps Alvaro would confirm that). That leads to the > conclusion that what's wrong is the release notes' query for fingering > broken constraints, and it needs some additional

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-28 Thread Paul Foerster
Hi Tom, hi Alvaro, > On 27 Nov 2024, at 19:52, Tom Lane wrote: > > Okay, so I was able to reproduce this from scratch on HEAD: great, thanks. > I doubt that there's anything actually wrong with the catalog state at > this point (perhaps Alvaro would confirm that). That leads to the > conclusi

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-27 Thread Alvaro Herrera
On 2024-Nov-27, Tom Lane wrote: > I doubt that there's anything actually wrong with the catalog state at > this point (perhaps Alvaro would confirm that). That leads to the > conclusion that what's wrong is the release notes' query for fingering > broken constraints, and it needs some additional

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-27 Thread Tom Lane
Paul Foerster writes: > On 26 Nov 2024, at 22:25, Tom Lane wrote: >> I'm suspicious that our repair recipe might not have accounted >> for self-reference FKs fully, but that's just a gut feeling at >> this point. > Of course, it contains no secret data. Please find the full log below. > Accordi

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-26 Thread Paul Foerster
Hi Tom, > On 26 Nov 2024, at 22:25, Tom Lane wrote: > > I would have expected an empty result too. Can you confirm that > p_ci_pipelines used to be a partition of something? Can you show us > the full DDL (or psql \d+ output) for the partitioned table it > used to be part of, and for that matt

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-26 Thread Tom Lane
Paul Foerster writes: >> On 26 Nov 2024, at 17:56, Adrian Klaver wrote: >> When you run the query again do you get the same two statements? > Yes. I can repeat the above 4 steps as much as I want. The result remains the > same. I would have expected to have an empty result doing the final repea

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-26 Thread Paul Foerster
Hi Adrian, > On 26 Nov 2024, at 17:56, Adrian Klaver wrote: > > Did you commit the statements? Yes. I have autocommit on, the psql default. > Are you using concurrent sessions to do this? No. I do this in one session. 1. select, 2. drop, 3. add, 4. select. > When you run the query again do y

Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-26 Thread Adrian Klaver
On 11/26/24 01:59, Paul Foerster wrote: Hi, I have a question regarding the recent security update for PostgreSQL 15. We have a gitlab database. It used to run on the PostgreSQL 15.8 software. I updated from 15.8 to 15.10 and executed the corrective actions as outlined in: https://www.postgre

PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION

2024-11-26 Thread Paul Foerster
Hi, I have a question regarding the recent security update for PostgreSQL 15. We have a gitlab database. It used to run on the PostgreSQL 15.8 software. I updated from 15.8 to 15.10 and executed the corrective actions as outlined in: https://www.postgresql.org/about/news/postgresql-171-165-159-