Skip to content

Commit d8e70cd

Browse files
committed
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
1 parent eb1fb86 commit d8e70cd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/backend/utils/adt/ri_triggers.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Portions Copyright (c) 2000-2001, PostgreSQL Global Development Group
1919
* Copyright 1999 Jan Wieck
2020
*
21-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.32 2002/03/06 06:10:14 momjian Exp $
21+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.33 2002/03/19 02:57:15 momjian Exp $
2222
*
2323
* ----------
2424
*/
@@ -208,6 +208,17 @@ RI_FKey_check(PG_FUNCTION_ARGS)
208208
new_row = trigdata->tg_trigtuple;
209209
}
210210

211+
/*
212+
* We should not even consider checking the row if it is no longer
213+
* valid since it was either deleted (doesn't matter) or updated
214+
* (in which case it'll be checked with its final values).
215+
*/
216+
if (new_row) {
217+
if (!HeapTupleSatisfiesItself(new_row->t_data)) {
218+
return PointerGetDatum(NULL);
219+
}
220+
}
221+
211222
/* ----------
212223
* SQL3 11.9 <referential constraint definition>
213224
* Gereral rules 2) a):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy