Re: Triggers not working

From: "Dale Harris" <itsupport(at)jonkers(dot)com(dot)au>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Triggers not working
Date: 2008-09-23 03:56:25
Message-ID: 00bb01c91d30$5cd21f80$16765e80$@com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would have called the Entity table the parent table and not the child
table as the Account table inherits from Entity. Therefore it appears that
the trigger only works on the table where the actual row was added/belongs
to.

It would be great if triggers on the parent table would work for any row
that appears there, even rows added via a child table. It would mean that
any new table that inherits the parent table, in my case Entity, would
automatically have the global trigger I want enforced. Nice enhancement :)

Regards,

Dale Harris.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Tuesday, 23 September 2008 13:43
To: Dale Harris
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Triggers not working

"Dale Harris" <itsupport(at)jonkers(dot)com(dot)au> writes:
> The trigger trAccountUpdate got called, but why didn't the trigger
> trEntityUpdate get called?

Triggers only apply to the exact table they're declared on, not
to child tables.

It does seem like there might be some use-case for applying a trigger to
child tables too, but that's not how it works now.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-09-23 04:13:42 Re: match an IP address
Previous Message Tom Lane 2008-09-23 03:43:20 Re: Triggers not working