pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Igal @ Lucee.org <igal@lucee.org>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Trigger function does not modify the NEW value
Date: Fri, 28 Jun 2019 20:13:16 -0700
Message-ID: <1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org> (raw)
In-Reply-To: <CAKJS1f_k6umFSAyKQd68YRM0-JF=CsAbZ-ALoCQjCp9WKCpcLg@mail.gmail.com>
References: <04592c40-829d-a31e-790a-96afbc108c0a@lucee.org>
	<CAKJS1f_k6umFSAyKQd68YRM0-JF=CsAbZ-ALoCQjCp9WKCpcLg@mail.gmail.com>

On 6/28/2019 8:07 PM, David Rowley wrote:
> On Sat, 29 Jun 2019 at 14:54, Igal @ Lucee.org <igal@lucee.org> wrote:
>>      create trigger tr_on_table_modified after insert or delete or update
>>          on some_table for each row execute procedure on_table_modified();
>> I can see in the output the notices with the expected values, but the value in the updated record is not lower-cased.
> You'll need a BEFORE trigger, not an AFTER trigger.
> https://www.postgresql.org/docs/current/sql-createtrigger.html

*facepalm*

I was trying to "save" on creating a separate trigger so I added that to 
the bottom of an existing one and missed that.

Thanks David!

Igal







view thread (3+ messages)

Message-ID: <1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org>
Permalink:  ../1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org/
Also on:    postgresql.org/message-id/1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: igal@lucee.org, david.rowley@2ndquadrant.com
  Subject: Re: Trigger function does not modify the NEW value
  In-Reply-To: <1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org>
  References: <04592c40-829d-a31e-790a-96afbc108c0a@lucee.org> <CAKJS1f_k6umFSAyKQd68YRM0-JF=CsAbZ-ALoCQjCp9WKCpcLg@mail.gmail.com> <1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox