Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlhlG-0002Z3-L0 for pgsql-docs@arkaria.postgresql.org; Tue, 03 May 2022 01:55:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nlhlF-0003Sv-E5 for pgsql-docs@arkaria.postgresql.org; Tue, 03 May 2022 01:55:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlhlF-0003S0-31 for pgsql-docs@lists.postgresql.org; Tue, 03 May 2022 01:55:33 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nlhlA-0008EC-NI for pgsql-docs@lists.postgresql.org; Tue, 03 May 2022 01:55:32 +0000 Received: by mail-ed1-x530.google.com with SMTP id be20so18411028edb.12 for ; Mon, 02 May 2022 18:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iLIgz+0BxCuSQcxLtIRwLDeMhwQZ4G4OOM9/MgCNmmk=; b=VX2MPG7spW79/NYIDvFlwRXEx3G2wPPahoh0gvGmWotC4/Fb40Hkb86gE312qLGP+e wKpOHe4gI/Cjg+cklgU4Z9KSEn1wsUtPGzuIKg4QTQif1uFv6NSpM+ZU9kR14LomT6nJ Cto//Zby1Pd+9uRkKDrl2gvm8kmE+RsR7Z21P63BmaoQ0D808xaXFvimfiRFLJUx5vS+ Clxh8+JkA0MvHzhAdECZdwY7SfKzd7wC+shoIt/2Q57I2Wh+Qw6QRS1BkGiaBTUM/Ynh TMlg+nLkwTfM2Mtt8uRgJIAJDeUYy7FEIDxM1L44ZSdUxjRUX5mPmJcxnfyYbt+TF+Rk yWYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iLIgz+0BxCuSQcxLtIRwLDeMhwQZ4G4OOM9/MgCNmmk=; b=e5kVM6damxzxNFmtNdK63jfCfZ9xqSCBE8srwTiqGhHppNgiNlglD+3KcjZOLqVhCy BI2ORyFju82fTivHZIlzqnzdMyVIsK9yMrxk691GCh6VOdbV5sGYPQC13PrdbzmtSS+A cO82yOwY6AgShc1stBNSpmm1M3w+hpV75RE8ONXNDWdcaHwgG0J+ozLRhKnGTI9oEtwV C6jzx3uTTYK7xMP/zmGu3+OmnPFsYPlfG9TwNRhFIrs9gsf9mkmHmmn4bcFKSWwaB72C wr0kFRGg0yNO1wYENX2iZcUxsJ371v5Ei+WinBxI8lAkeVqtkRJEwoSVaGyOeOLamjAU 7JXw== X-Gm-Message-State: AOAM531KMXX4KgZTHWUqlwHTi6hipthLklUJtjtJGCa3C0P3O2hRMjqR /77A7XPFvTqU6SSp5CjgqlGY749/H5Yiq21ilb1rY89xkpc= X-Google-Smtp-Source: ABdhPJz61Ze50WAwT7avuRSl/xn1iHtZKF6C/Zc1s6uST0Jx4lczQd7QtrlxNR/1dzb0M4NA+/Bk+t/WwJJtZUFm074= X-Received: by 2002:a05:6402:1941:b0:413:2b5f:9074 with SMTP id f1-20020a056402194100b004132b5f9074mr15646914edz.414.1651542927786; Mon, 02 May 2022 18:55:27 -0700 (PDT) MIME-Version: 1.0 References: <165151321896.685.16545084197561479198@wrigleys.postgresql.org> In-Reply-To: From: "David G. Johnston" Date: Mon, 2 May 2022 18:55:09 -0700 Message-ID: Subject: Re: Clarification of triggers with 'OF column_name' in 'Overview of Trigger Behavior' To: Josh Silver Cc: Pg Docs Content-Type: multipart/alternative; boundary="0000000000008ac3f205de11cd11" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008ac3f205de11cd11 Content-Type: text/plain; charset="UTF-8" On Mon, May 2, 2022 at 6:33 PM Josh Silver 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". David J. --0000000000008ac3f205de11cd11 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, May 2, 2022 at 6:33 PM Josh Silver <josh.ag@pal= adin.insure> wrote:
<= div dir=3D"ltr">

and the=C2=A0 &#= 39;Overview of Trigger Behavior pages says of before triggers
In row-lev= el triggers the=C2=A0WHEN=C2=A0condition can examine the old and/or new values of = columns of the row. (Statement-level triggers can also have=C2=A0WHEN=C2=A0conditi= ons, although the feature is not so useful for them.) In a=C2=A0BEFORE=C2=A0trigge= r, the=C2=A0WHEN=C2=A0condition is evaluated just before the function is or would = be executed, so using=C2=A0WHEN=C2=A0is not materially different from testing the = same condition at the beginning of the trigger function.
=C2=A0
but does not even mention=C2=A0column specific trigg= ers by name.


The previous paragraph reads in part:

"If more t= han one trigger is defined for the same event on the same relation, the tri= ggers 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/S= ELECT=C2=A0+ any column limitation".

So, it is co= vered if you understand the column aspect is rolled into "trigger even= t".

David J.

--0000000000008ac3f205de11cd11--