Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hh3nr-0007ZR-MV for pgsql-general@arkaria.postgresql.org; Sat, 29 Jun 2019 03:13:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hh3nq-0005Dt-H4 for pgsql-general@arkaria.postgresql.org; Sat, 29 Jun 2019 03:13:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hh3nq-0005Dl-7J for pgsql-general@lists.postgresql.org; Sat, 29 Jun 2019 03:13:26 +0000 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hh3nm-0008P2-LA for pgsql-general@postgresql.org; Sat, 29 Jun 2019 03:13:25 +0000 Received: by mail-oi1-x242.google.com with SMTP id s184so5732297oie.9 for ; Fri, 28 Jun 2019 20:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lucee.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=fwcIz6EZo4vcJ1EpKpR8p2PgZMhG9T5JBysUuddGGQs=; b=KgzNkgH4BeEejfnkEdAqb62acrikjXg0bCqwXLch4X2dOHUYNa+8w/eicAGxJi3lD7 Go/1ZhD4EQ+qRgwkKXoSD3WCPhFGNnjxX78GGVibCRpXe2L6JhOydcv17c9kLu/mayb/ SHTrDpzrl3NfrmPJFICQnMafuWT7sJrYNS8tuHY4amOUM65gwDn9pBCnGkOuuYz4EGyt K2v3bXeh5vM7Tg4qrBGrmdtJqd+0gY8RaU9zN3xxqsV7iXMkZmddke1n1CfQw95RPoG3 mbOjA/EpoaxFOMyrzk0YXij+OGIqzJkzYSCyr0BATCNfjDgro9Ml+ACBSkE8nz/a9C5z 066w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=fwcIz6EZo4vcJ1EpKpR8p2PgZMhG9T5JBysUuddGGQs=; b=ZkC5Hz1qgw17AfJa0XCaMWDT9ssq/U07LGxzS0RzvccL8oniFXYzf9vO0Et9+9uIRe HCafiBdatFxK8CS9jkpsNHDuXx8hu1CR0ts5WvjGZbpn0P6EtzokrZq/qc4jkeoQw6sT dpErIT3yKCRpXOL6ApWNA1zKftmEKTFoPszZdk72eVeHRGs4jPK8ommalOUezwuU64sl qjs5+JKMj0xQnqQCIzyRkizQxzXz/AO6rpLqLoTH5z59msKwoTD38HDedTYD6mmNihdW yupJ7O6VifR8qfYdWYattBb8F7TgG1zkJwJ8HSi8NBdd/w+IwZikUM+3qAb2OX+2Rl07 /BFw== X-Gm-Message-State: APjAAAW9EWKsqy+LCO1Ty0hLDyVryO+9eiNovZgyeRo+vdKkgXy8W/Fl 0GP6MCUmDKp4RhoEb8O7fX0Ty4y6ayA= X-Google-Smtp-Source: APXvYqzUSgWvQqGiKLNrEvjrnptCfwSPQUsTpHusrUACv9GYMwUj1AY6RxO5FHnEpJndNYtZmjbnUA== X-Received: by 2002:a05:6808:690:: with SMTP id k16mr574243oig.117.1561777999039; Fri, 28 Jun 2019 20:13:19 -0700 (PDT) Received: from ?IPv6:2600:1700:4000:8120:96c:1499:2744:6b9e? ([2600:1700:4000:8120:96c:1499:2744:6b9e]) by smtp.googlemail.com with ESMTPSA id k10sm1465795otn.58.2019.06.28.20.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 20:13:18 -0700 (PDT) Subject: Re: Trigger function does not modify the NEW value To: David Rowley Cc: pgsql-general References: <04592c40-829d-a31e-790a-96afbc108c0a@lucee.org> From: "Igal @ Lucee.org" Message-ID: <1476e550-ac2e-949a-5f4d-b29d0ad1203e@lucee.org> Date: Fri, 28 Jun 2019 20:13:16 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/28/2019 8:07 PM, David Rowley wrote: > On Sat, 29 Jun 2019 at 14:54, 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