Re: ALTER TABLE validate foreign key dependency problem

Simon Riggs <simon@2ndquadrant.com>

From: Simon Riggs <simon@2ndquadrant.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-07-12T20:12:52Z
Lists: pgsql-hackers
On Sun, 12 Jul 2020 at 05:51, David Rowley <dgrowleyml@gmail.com> wrote:


> > 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.
>

Consistency seems the better choice, so I agree we should validate later in
all cases. Does changing that have any other effects?

-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
Mission Critical Databases

Commits

  1. Fix timing issue with ALTER TABLE's validate constraint