提交 04841751 编写于 作者: A Alvaro Herrera

Fix pg_get_constraintdef to cope with NOT VALID constraints

This case was missed when NOT VALID constraints were first introduced in
commit 722bf701 by Simon Riggs on
2011-02-08.  Among other things, it causes pg_dump to omit the NOT VALID
flag when dumping such constraints, which may cause them to fail to
load afterwards, if they contained values failing the constraint.

Per report from Thom Brown.
上级 ea8e42f3
......@@ -1373,6 +1373,9 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
if (conForm->condeferred)
appendStringInfo(&buf, " INITIALLY DEFERRED");
if (!conForm->convalidated)
appendStringInfoString(&buf, " NOT VALID");
/* Cleanup */
ReleaseSysCache(tup);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册