Re: Statement-level triggers and inheritance

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Statement-level triggers and inheritance
Date: 2008-12-01 15:31:51
Message-ID: b7430f501312d87d4494bb95e726caa7@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

>>> My feeling is that it ought to fire such triggers on *each* target.

>> This would amount to statement level triggers firing multiple times per
>> statement wouldn't it?

> No, because they'd be different triggers. A trigger on a parent table
> has got nothing to do with triggers on children.

I think Robert's point is that, even though they are different triggers,
we would be firing more than one "statement-level" trigger per statement.
Which feels a little odd, but is perfectly valid.

However, I strongly lean towards the behavior in this case being to only
fire the parent statement-level trigger. I could support the other way as
well: I'm not going to add any triggers to the children anyway, so as long
as the parent fires, I'll be happy. Right now, this is a serious bug for
my app, as there is no INSERT INTO ONLY syntax, and thus there is no way
to effect a statement-level trigger using an insert on a table that is
inherited from. My workaround is to insert and then update all the rows.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation
PGP Key: 0x14964AC8 200812011030
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkk0AzUACgkQvJuQZxSWSsgFMQCg1aqkiX4CdEZL7+jXEDof8/xm
lMQAoOYyoW2gp/7UGqq9kXul9FOqxk4o
=m6ua
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2008-12-01 15:33:28 Re: New to_timestamp implementation is pretty strict
Previous Message Magnus Hagander 2008-12-01 15:31:46 Re: Re: [COMMITTERS] pgsql: Add support for matching wildcard server certificates to the new