Re: creating CHECK constraints as NOT VALID
Jaime Casanova <jaime@2ndquadrant.com>
From: Jaime Casanova <jaime@2ndquadrant.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Dean Rasheed <dean.a.rasheed@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2011-06-18T06:57:22Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix pg_get_constraintdef to cope with NOT VALID constraints
- 048417511aef 9.1.0 cited
On Thu, Jun 16, 2011 at 4:10 AM, Jaime Casanova <jaime@2ndquadrant.com> wrote: > On Wed, Jun 15, 2011 at 7:08 PM, Alvaro Herrera > <alvherre@commandprompt.com> wrote: >> >> Yeah, nothing serious. Updated patch attached. The wording in the doc >> changes could probably use some look over. >> > > looks good to me... at least it compiles, and function as i would expect... > tomorrow i will read the code more carefully and look at the docs, but > probably this is just fine to be commited... > I think that this paragraph is confusing, but not being an natural english speaker i will let others give their opinion here: ! If NOT VALID is not specified, ! the command will only succeed if all columns using the ! domain satisfy the new constraint. ! The constraint is going to be enforced on new data inserted into columns ! using the domain in all cases, regardless of <literal>NOT VALID</>. ! <literal>NOT VALID</> is only accepted for <literal>CHECK</> constraints. Even if it is redundant maybe here should say "This form validates a constraint previously added as NOT VALID", otherwise someone could think that by default constraints are not enforced and should be validated + <term>VALIDATE CONSTRAINT</term> + <listitem> + <para> + This form validates a constraint previously added, that is, verify that + all data in columns using the domain satisfy the specified constraint. + </para> + </listitem> + </varlistentry> otherwise the patch looks good, and works fine in every test i could imagine... -- Jaime Casanova www.2ndQuadrant.com Professional PostgreSQL: Soporte 24x7 y capacitación