public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Josh Silver <[email protected]>
Cc: Pg Docs <[email protected]>
Subject: Re: Clarification of triggers with 'OF column_name' in 'Overview of Trigger Behavior'
Date: Mon, 2 May 2022 19:10:53 -0700
Message-ID: <CAKFQuwbXC89bF+ZeoGGdWFamq3m_BHYqS2ZtALORfGHRZCmp3w@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwZg7rh9UsyLEn7+=fc-fvT2f4MDtbFehvCvrGte+YUTpQ@mail.gmail.com>
References: <[email protected]>
<CAKFQuwY=c7t3PpihnsrcQPOGoKGyWFuvA5x9bwSSBZSJTz_tgQ@mail.gmail.com>
<CADRdQa27rS+GpdYu_sV9Bjdu9vVtCthdFSv7ABZt0M9xHiPSMA@mail.gmail.com>
<CAKFQuwYYS_yKFFgcZe18UBc6VPVJuVmLbTR20Vb0xCL+N5MCKw@mail.gmail.com>
<CADRdQa0ow74BwKDcpU-MCYcRJfQER5mZ+phL4iJWABRHgkXraw@mail.gmail.com>
<CAKFQuwZg7rh9UsyLEn7+=fc-fvT2f4MDtbFehvCvrGte+YUTpQ@mail.gmail.com>
On Mon, May 2, 2022 at 6:55 PM David G. Johnston <[email protected]>
wrote:
> On Mon, May 2, 2022 at 6:33 PM Josh Silver <[email protected]> wrote:
>
>>
>> and the 'Overview of Trigger Behavior pages says of before triggers
>>
>>> In row-level triggers the WHEN condition can examine the old and/or new
>>> values of columns of the row. (Statement-level triggers can also have
>>> WHEN conditions, although the feature is not so useful for them.) In a
>>> BEFORE trigger, the WHEN condition is evaluated just before the
>>> function is or would be executed, so using WHEN is not materially
>>> different from testing the same condition at the beginning of the trigger
>>> function.
>>
>>
>> but does not even mention column specific triggers by name.
>>
>>
> The previous paragraph reads in part:
>
> "If more than one trigger is defined for the same event on the same
> relation, the triggers will be fired in alphabetical order by trigger name."
>
> I'll say that we don't provide a granular definition of what an "event" is
> here - namely the "INSERT/UPDATE/DELETE/SELECT + any column limitation".
>
> So, it is covered if you understand the column aspect is rolled into
> "trigger event".
>
>
And, given the existing length and depth of content of that page already
I'm doubtful that introducing the corner-case of UPDATE OF (col) into that
section, in the level of detail provided in CREATE TRIGGER, is a net
positive. I'd probably leave the detail where it is, note that "UPDATE OF
(col)" exists as a distinct event type that modifies a plain UPDATE
TRIGGER's event check, and direct the reader to the specifics in CREATE
TRIGGER should they feel the need to use the more specific form. Nothing
in the "Overview" page is negated just because a column is specified on the
UPDATE trigger.
David J.
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Clarification of triggers with 'OF column_name' in 'Overview of Trigger Behavior'
In-Reply-To: <CAKFQuwbXC89bF+ZeoGGdWFamq3m_BHYqS2ZtALORfGHRZCmp3w@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox