Re: Fix comment in ATExecValidateConstraint

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix comment in ATExecValidateConstraint
Date: 2016-08-16 04:45:47
Message-ID: 6255599b-3dde-ad3e-1520-9dc6482a4257@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/07/29 23:50, Robert Haas wrote:
> On Mon, Jul 25, 2016 at 4:18 AM, Amit Langote
> <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> The comment seems to have been copied from ATExecAddColumn, which says:
>>
>> /*
>> * If we are told not to recurse, there had better not be any
>> - * child tables; else the addition would put them out of step.
>>
>> For ATExecValidateConstraint, it should say something like:
>>
>> + * child tables; else validating the constraint would put them
>> + * out of step.
>>
>> Attached patch fixes it.
>
> I agree that the current comment is wrong, but what does "out of step"
> actually mean here, anyway? I think this isn't very clear.

Like Tom explained over at [1], I guess it means if a constraint is marked
validated in parent, the same constraint in all the children should have
been marked validated as well. Validating just the parent's copy seems to
break this invariant. I admit though that I don't know if the phrase "out
of step" conveys that.

Thanks,
Amit

[1] https://www.postgresql.org/message-id/13658.1470072749%40sss.pgh.pa.us

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message amul sul 2016-08-16 05:04:06 Re: Bug in to_timestamp().
Previous Message Adam Brusselback 2016-08-16 04:39:32 Re: C++ port of Postgres