Re: NOT ENFORCED constraint feature - Mailing list pgsql-hackers

From jian he
Subject Re: NOT ENFORCED constraint feature
Date
Msg-id CACJufxFV7bZhYnBpQVubrYPN-pSsCs7MYBMNmn34oFwuexos_g@mail.gmail.com
Whole thread Raw
In response to Re: NOT ENFORCED constraint feature  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
>
> errmsg("cannot validated NOT ENFORCED constraint")));
> should be
> errmsg("cannot validate NOT ENFORCED constraint")));
> ?
>

looking at it again.

    if (!con->conenforced)
        ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                 errmsg("cannot validated NOT ENFORCED constraint")));

ERRCODE_WRONG_OBJECT_TYPE is not that ok? maybe
ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
or
ERRCODE_INVALID_TABLE_DEFINITION


if (!con->conenforced)
       ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                 errmsg("cannot validated NOT ENFORCED constraint")));
if (!con->convalidated)
{
....
if (con->contype == CONSTRAINT_FOREIGN)
 {
            /*
             * Queue validation for phase 3 only if constraint is enforced;
             * otherwise, adding it to the validation queue won't be very
             * effective, as the verification will be skipped.
             */
            if (con->conenforced)
             ......
 }

in ATExecValidateConstraint "" if (con->conenforced)"""  will always be true?



pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Incorrect result of bitmap heap scan.
Next
From: vignesh C
Date:
Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation