From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oleg Mayevskiy <oleg.mayevskiy@s2002.tu-chemnitz.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: insert or update violates foreign key constraint.why?
Date: Mon, 31 May 2004 22:05:11 -0400
Message-ID: <14140.1086055511@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.58.0405281547380.22455@pandora.hrz.tu-chemnitz.de>
References: <Pine.LNX.4.58.0405281547380.22455@pandora.hrz.tu-chemnitz.de>
Oleg Mayevskiy <oleg.mayevskiy@s2002.tu-chemnitz.de> writes:
> it seems to be a simple problem, but it is not.
Yes it is ... you're expecting the RI triggers to fire during the
plpgsql function, but in fact they fire at completion of the outer
statement that called the plpgsql function.
There's been some debate about whether this is really the most
desirable behavior, but that's how it is at the moment.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, oleg.mayevskiy@s2002.tu-chemnitz.de
Subject: Re: insert or update violates foreign key constraint.why?
In-Reply-To: <14140.1086055511@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox