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 20:34:02
Message-ID: 20180128203402.GB4380@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Sun, Jan 28, 2018 at 02:18:38PM -0500, Tom Lane wrote:
> Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> > On Thu, Jan 25, 2018 at 11:07 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >> ... The attached patch updates the docs to say
> >> statement-level triggers fire on the "referenced" table, while row-level
> >> triggers fire only on the "affected" table, (vs. all affected tables)
> >> even if they are not referenced in the query. I would backpatch this to
> >> PG 10.
>
> > I was trying to convey that, but it does seem a little terse and
> > cryptic. Your addition of "referenced" and "only" make it clearer.
>
> Hm, the first part of Bruce's change seems fine, but I think this wording:
>
> ... In contrast,
> ! row-level triggers are fired only on affected partitions or child tables,
> ! even if they are not referenced in the query.
>
> is still confusing. How about something like
>
> In contrast, row-level triggers are fired for each actual row change,
> including changes in partitions or child tables that are not directly
> named in the query.
>
> Possibly "row operation" would be better than "row change".

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.

--
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 20:57:07 Re: Trigger behaviour not as stated
Previous Message Tom Lane 2018-01-28 19:18:38 Re: Trigger behaviour not as stated