*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.332.2.2 2010/07/29 19:23:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.332.2.3 2010/08/03 15:47:09 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
CommandCounterIncrement();
/*
+ * If the constraint got merged with an existing constraint, we're done.
+ * We mustn't recurse to child tables in this case, because they've already
+ * got the constraint, and visiting them again would lead to an incorrect
+ * value for coninhcount.
+ */
+ if (newcons == NIL)
+ return;
+
+ /*
* Propagate to children as appropriate. Unlike most other ALTER
* routines, we have to do this one level of recursion at a time; we can't
* use find_all_inheritors to do it in one pass.