Re: ALTER TABLE validate foreign key dependency problem
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-07-12T04:50:46Z
Lists: pgsql-hackers
Attachments
- delay_altertable_foreignkey_validation_during_table_rewrite10_v2.patch (application/octet-stream) patch v2
- delay_altertable_foreignkey_validation_during_table_rewrite95_v2.patch (application/octet-stream) patch v2
- delay_altertable_foreignkey_validation_during_table_rewrite12_v2.patch (application/octet-stream) patch v2
On Thu, 9 Jul 2020 at 15:54, David Rowley <dgrowleyml@gmail.com> wrote: > I think the fix is just to delay the foreign key validation when > there's a rewrite pending until the rewrite is complete. I looked over this again and only slightly reworded a comment. The problem exists as far back as 9.5 so I've attached 3 patches that, pending any objections, I plan to push about 24 hours from now. > I also considered that we could just delay all foreign key validations > until phase 3, but I ended up just doing then only when a rewrite is > pending. I still wonder if it's best to delay the validation of the foreign key regardless of if there's a pending table rewrite, but the patch as it is now only delays if there's a pending rewrite. David
Commits
-
Fix timing issue with ALTER TABLE's validate constraint
- 1231a0b0ea66 12.4 landed
- e20003fa0f8d 9.5.23 landed
- c732df133a3d 9.6.19 landed
- 4e02f88a4eed 10.14 landed
- d2761b680a90 11.9 landed
- b827304291af 13.0 landed
- f1fcf2d3b2e0 14.0 landed