Re: Trigger function does not modify the NEW value - Mailing list pgsql-general

From Igal @ Lucee.org
Subject Re: Trigger function does not modify the NEW value
Date
Msg-id 1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org
Whole thread Raw
In response to Re: Trigger function does not modify the NEW value  (David Rowley <david.rowley@2ndquadrant.com>)
Responses How to get non-existant values as NULL or 0?
List pgsql-general
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





pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: Trigger function does not modify the NEW value
Next
From: Alexander Farber
Date:
Subject: Azure Database for PostgreSQL - how to add pgbouncer or similar?