Skip site navigation (1) Skip section navigation (2)

Re: BUG #2927: Trigger execution hides foreign key error

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Jaume Catarineu <jaume(at)nobainfo(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2927: Trigger execution hides foreign key error
Date: 2007-01-24 21:04:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Jaume Catarineu wrote:
> The following bug has been logged online:
> Bug reference:      2927
> Logged by:          Jaume Catarineu
> Email address:      jaume(at)nobainfo(dot)net
> PostgreSQL version: 8.2.1
> Operating system:   Linux srvca01 #1 SMP Wed Mar 23
> 21:52:37 UTC 2005 i686 i686 i386 GNU/Linux
> Description:        Trigger execution hides foreign key error
> Details: 
> When a table has a foreign key field if you insert values that violate that
> check an error appears:
> ERROR:  insert or update on table "m_tran" violates foreign key constraint
> "m_tran_fk"
> That's ok, but when a INSERT trigger is added to that table, the precedent
> insert order productes the following output:
> INSERT 0 0
> And no error appears anywhere: neither in the log nor the psql console.
> Shouldn't PostgreSQL inform someway why it's not going to insert that row?

well you have not show us the source of the trigger and tables involved
but most likely your (BEFORE?) trigger is actively suppressing the
insert of the row. And an insert that is not actually inserting any data
is rather unlikely to cause any fk-violations ...


In response to

pgsql-bugs by date

Next:From: Michael SchmidtDate: 2007-01-25 00:20:13
Subject: BUG #2931: Can't capture pg_dump Password prompt
Previous:From: Stefan KaltenbrunnerDate: 2007-01-24 20:59:02
Subject: Re: BUG #2929: Error opening 5432 port

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group