Re: Trigger behaviour not as stated

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, ian(at)thepathcentral(dot)com, pgsql-docs(at)postgresql(dot)org, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Subject: Re: Trigger behaviour not as stated
Date: 2018-01-28 22:58:24
Message-ID: 20180128225824.GA5022@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Sun, Jan 28, 2018 at 03:57:07PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Uh, I don't think we want to highlight the statement vs row difference
> > here but the fact that statement triggers fire on the referenced object
> > and not on the effected rows. I have attached an updated patch which I
> > think is an improvement
>
> statement-level triggers for its partitions or child tables. In contrast,
> ! row-level triggers are fired on the rows in effected partitions or
> ! child tables, even if they are not referenced in the query.
>
> I still think that that's not well written. A large part of the confusion
> here is over what "referenced" means. To my mind, child tables/partitions
> are referenced by an inherited query, just not explicitly. So that's why
> I'd prefer wording like "directly named in the query" (or "explicitly
> named"). If you insist on using "referenced" you could write "explicitly
> referenced", but IMO that's longer and no clearer.
>
> A lesser complaint is that this reads like the antecedent of "they" is the
> rows, not the tables containing them, making the meaning of "referenced"
> even less clear.
>
> Maybe something like
>
> In contrast, row-level triggers are fired for individual row change
> events, and the triggers that are fired for an event are those
> attached to the specific table containing the changed row, even if
> it is a partition or child table not directly named in the query.

Oh, I am sorry. I was focused on the first part of the sentence and
didn't notice your change to the second part. How is this attachment?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

Attachment Content-Type Size
trigger.diff text/x-diff 1.5 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2018-01-28 23:12:01 Re: Trigger behaviour not as stated
Previous Message Tom Lane 2018-01-28 20:57:07 Re: Trigger behaviour not as stated