Search Postgresql Archives

Re: AFTER triggers and constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vick Khera [mailto:vivek@xxxxxxxxx]
Sent: Friday, June 28, 2013 9:35 AM
To: David Greco
Cc: pgsql-general@xxxxxxxxxxxxxx
Subject: Re: AFTER triggers and constraints

 

 

On Fri, Jun 28, 2013 at 8:45 AM, David Greco <David_Greco@xxxxxxxxxxxxxxx> wrote:

The last delete statement will throw a referential integrity error. In Oracle, same example, it does not as the trigger deletes the child.


Not sure your real case, but why not just make the FK on delete cascade and get rid of your trigger entirely?

 

Alternatively, what if you make your constratint initially deferred?

 

 

 

 

The actual use case is a bit different and complicated.  When the constraint is initially deferred, it works as expected, and that is how I will work around the issue.  But my point is, is this how it is SUPPOSED to work? It’s not clear to me yet that is the case. I would expect the statement to include the after row triggers (but not the after statement triggers).

 

 

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux