Firing trigger if only

From: Gabriel <yu1nis(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Firing trigger if only
Date: 2014-04-03 11:50:59
Message-ID: 1396525859084-5798484.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Good afternoon all.I have some problem with triggers on PostgreSQL 8.4.I have
a trigger on specific table(articles) that fires on update statement:

CREATE OR REPLACE FUNCTION trigger_articles_update()
RETURNS trigger AS
$BODY$BEGIN
INSERT INTO
article_change(article_id,change_type)VALUES(OLD.article_id,2);
RETURN NULL;
END$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION trigger_articles_update() OWNER TO postgres;

I have 2 different applications that performs update on table
articles(written in Delphi and using ZeosDB). My problem is that I want
trigger to fire only when performing update with first application, but not
with second.I know that triggers supposed to fire on every change on table,
but this is a specific problem that I have.Any hint appreciated. 8)

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Firing-trigger-if-only-tp5798484.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-04-03 12:02:27 Re: GSoC proposal - "make an unlogged table logged"
Previous Message Andrew Dunstan 2014-04-03 11:43:37 Re: json(b) equality rules