Re: Trigger definition . . . puzzled

From: "Rolf A(dot) de By" <deby(at)itc(dot)nl>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Trigger definition . . . puzzled
Date: 2007-12-13 15:59:43
Message-ID: 476156EF.8080901@itc.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks Tom,

Yes, this is an inheritance set-up. But actually no: I am executing all
my data changes against the parent table, and want the trigger on that
parent table to fire for an insert on the parent table as it does. But
I also want the trigger to fire when an update on the parent table is
executed, and this does not happen.

Rolf

Tom Lane wrote:
> "Rolf A. de By" <deby(at)itc(dot)nl> writes:
>
>> Thanks for that. There is some misunderstanding here. For this example,
>> I had taken the sting out of my trigger function and turned it into a
>> much more concise no-op, with warnings. The actual code of my original
>> trigger function is irrelevant. The no-op trigger function displays the
>> same strange behaviour: it works as expected for INSERTs, but not for
>> UPDATEs. The update goes through! And it shouldn't.
>>
>
> Reading between the lines, I gather you have an inheritance setup and
> are expecting a trigger on the parent table to fire for events occurring
> in the child tables. Doesn't work like that; you need to put triggers
> on the child tables.
>
> regards, tom lane
>

--

dr ir Rolf A. de By

assoc prof Geodata Management and Engineering
dept Geoinformation Processing
ITC -- International Institute for Geo-information Science & Earth Observation
Hengelosestraat 99
7500 AA Enschede, The Netherlands
ph +31 53 4874553 fx +31 53 4874335
email deby(at)itc(dot)nl

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-12-13 16:33:53 Re: Trigger definition . . . puzzled
Previous Message Tom Lane 2007-12-13 15:49:32 Re: Trigger definition . . . puzzled