提交 d8e70cd8 编写于 作者: B Bruce Momjian

Fix for trigger handling:

         * We should not even consider checking the row if it is no longer
         * valid since it was either deleted (doesn't matter) or updated
         * (in which case it'll be checked with its final values).

Stephan Szabo
上级 eb1fb865
......@@ -18,7 +18,7 @@
* Portions Copyright (c) 2000-2001, PostgreSQL Global Development Group
* Copyright 1999 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.32 2002/03/06 06:10:14 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.33 2002/03/19 02:57:15 momjian Exp $
*
* ----------
*/
......@@ -208,6 +208,17 @@ RI_FKey_check(PG_FUNCTION_ARGS)
new_row = trigdata->tg_trigtuple;
}
/*
* We should not even consider checking the row if it is no longer
* valid since it was either deleted (doesn't matter) or updated
* (in which case it'll be checked with its final values).
*/
if (new_row) {
if (!HeapTupleSatisfiesItself(new_row->t_data)) {
return PointerGetDatum(NULL);
}
}
/* ----------
* SQL3 11.9 <referential constraint definition>
* Gereral rules 2) a):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册