Re: Adding constraints faster

2024-05-14 Thread sud
On Wed, May 15, 2024 at 2:09 AM Ron Johnson wrote: > On Tue, May 14, 2024 at 3:59 PM sud wrote: > >> * >> > ALTER TABLE ADD FOREIGN KEY ... NOT VALID. >> ALTER TABLE ... VALIDATE CONSTRAINT; >> >> > This is what we did, back in the PG 12.x period. VALIDATE CONSTRAINT was > almost instantane

Adding constraints faster

2024-05-14 Thread sud
Hi, It's postgres version 15.4. We want to create foreign keys on three different partitioned tables which already have data in them in production. They all are referring to the same parent table which is also partitioned. All the tables(both parent and child) are having ~2TB+ in size each and havi