Re: Review: Non-inheritable check constraints - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Review: Non-inheritable check constraints
Date
Msg-id 1324317822-sup-7095@alvh.no-ip.org
Whole thread Raw
In response to Re: Review: Non-inheritable check constraints  (Alex Hunsaker <badalex@gmail.com>)
List pgsql-hackers
Excerpts from Alex Hunsaker's message of vie dic 16 18:07:05 -0300 2011:
>
> On Fri, Dec 16, 2011 at 14:01, Alvaro Herrera
> <alvherre@commandprompt.com> wrote:
> >
> > Excerpts from Alex Hunsaker's message of vie dic 16 17:50:12 -0300 2011:
> >>
> >> On Fri, Dec 16, 2011 at 12:06, Alvaro Herrera
> >> <alvherre@commandprompt.com> wrote:
> >>
> >> > Yeah.  Nikhil, Alex, this is the merged patch.  Have a look that it
> >> > still works for you (particularly the pg_dump bits) and I'll commit it.
> >> > I adjusted the regression test a bit too.
> >>
> >> Other than the version checks seem to be off by one looks fine.
> >
> > Uhm ... you're right that convalidated is present in 9.1 [...] So I
> > don't think we really need to add a separate branch for 9.1 here, but it
> > certainly needs a comment improvement.
>
> Hrm... What am I missing?

I was saying that it should all be >= 9.2.  There are no
convalidated=false check constraints in 9.1, so the extra branch is
useless.  This is sufficient:

@@ -6019,8 +6019,13 @@ getTableAttrs(TableInfo *tblinfo, int numTables)                         tbinfo->dobj.name);
     resetPQExpBuffer(q); 
-           if (g_fout->remoteVersion >= 90100)
+           if (g_fout->remoteVersion >= 90200)           {
+               /*
+                * conisonly and convalidated are new in 9.2 (actually, the latter
+                * is there in 9.1, but it wasn't ever false for check constraints
+                * until 9.2).
+                */               appendPQExpBuffer(q, "SELECT tableoid, oid, conname, "
"pg_catalog.pg_get_constraintdef(oid)AS consrc, "                                 "conislocal, convalidated, conisonly
"


--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: archive_keepalive_command
Next
From: Greg Smith
Date:
Subject: Re: Command Triggers