Re: Review: Non-inheritable check constraints

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Review: Non-inheritable check constraints
Date: 2011-12-19 18:05:29
Message-ID: 1324317822-sup-7095@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)commandprompt(dot)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(at)commandprompt(dot)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(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-12-19 18:25:38 Re: Command Triggers
Previous Message Simon Riggs 2011-12-19 18:02:05 Re: archive_keepalive_command