Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3NNvT329918 for ; Mon, 23 Apr 2001 19:57:29 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3NNvNR24245; Mon, 23 Apr 2001 19:57:23 -0400 (EDT) To: "Josh Berkus" cc: pgsql-sql@postgresql.org Subject: Re: Problems handling errors in PL/pgSQL In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Mon, 23 Apr 2001 12:48:57 -0700" Date: Mon, 23 Apr 2001 19:57:23 -0400 Message-ID: <24242.988070243@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/361 X-Sequence-Number: 2719 "Josh Berkus" writes: > However, not all types of errors are so trapped. The most problematic > un-trapped error is referential integrity: if an INSERT or UPDATE fails > because of a referential integrity violation, the PL/pgSQL function will > still see the statement as a success and not error out. This would clearly be a bug, but I cannot replicate the problem: regression=# SELECT fn_save_order_details (7703, '{34,29,40}','{TRUE, TRUE, FALSE}'); ERROR: referential integrity violation - key referenced from order_details not found in orders regression=# regards, tom lane