From: Andreas Joseph Krogh <andreas@visena.com>
To: pgsql-general@lists.postgresql.org
Subject: How to specify that a trigger should fire when column is NOT in SET-clause?
Date: Fri, 25 Dec 2020 14:52:28 +0100 (CET)
Message-ID: <VisenaEmail.26.7cbf2947c8d23ceb.1769a2755ff@tc7-visena> (raw)
Hi.
I need to set a value in a trigger if a column is explicitly NOT specified in
UPDATE's SET-clause.
Like for example having a "BEFORE UPDATE OF NOT"
create TRIGGER my_trigger BEFORE UPDATE OF NOT modified ON my_table FOR EACH
ROW WHEN(OLD.val <> NEW.val) EXECUTE PROCEDURE do_stuff();
I want the trigger to be fired when the column "modified" is NOT specified, is
it possible?
Or - is it possible to check for this in the trigger-function?
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com;
<https://www.visena.com;
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: andreas@visena.com
Subject: Re: How to specify that a trigger should fire when column is NOT in SET-clause?
In-Reply-To: <VisenaEmail.26.7cbf2947c8d23ceb.1769a2755ff@tc7-visena>
References: <VisenaEmail.26.7cbf2947c8d23ceb.1769a2755ff@tc7-visena>
* 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