Re: ALTER TABLE validate foreign key dependency problem

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ALTER TABLE validate foreign key dependency problem
Date: 2020-07-14 05:10:25
Message-ID: CAApHDvqSL=wFCgzwZqmLA2wNF=W7yS7Jx_ot1Di0_gASvBVPBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 13 Jul 2020 at 08:13, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>
> On Sun, 12 Jul 2020 at 05:51, David Rowley <dgrowleyml(at)gmail(dot)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?

Thanks for having a look here.

I looked at this again and noticed it wasn't just FOREIGN KEY
constraints. CHECK constraints were being validated at the wrong time
too.

I did end up going with unconditionally moving the validation until
phase 3. I've pushed fixed back to 9.5

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-07-14 05:22:19 Re: Improvements in Copy From
Previous Message vignesh C 2020-07-14 05:06:58 Re: Improvements in Copy From