Search Postgresql Archives

Re: Foreign key reference causes invalid DELETE trigger calls

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

 



"Andrus" <eetasoft@xxxxxxxxx> writes:
> Postgres 8.1 calls "foo" delete trigger when record is deleted from master 
> table "klient". Why ?

Because you have an ON DELETE CASCADE.  That leads to a DELETE ... WHERE ...
on the slave table; whether any records actually get deleted depends on
what the DELETE finds.  This is a general hazard of using STATEMENT
triggers: you have no info about whether the statement actually did
anything.  (It's rather silly to imagine that a BEFORE STATEMENT trigger
would have any way to know that anyway.  We currently don't tell an
AFTER STATEMENT trigger anything either; though that may change
someday.)

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[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