Skip site navigation (1) Skip section navigation (2)

Trigger isn't fired

From: Együd Csaba <csegyud(at)vnet(dot)hu>
To: "Pgsql-General(at)Postgresql(dot)Org (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Trigger isn't fired
Date: 2004-06-26 18:30:30
Message-ID: 015a01c45bab$a9888c10$230a0a0a@compaq (view raw or flat)
Thread:
Lists: pgsql-general
Hi,
I created a trigger function and a trigger with that function on a table. It
is an "after insert or update or delete" trigger, in which I want to modify
a second table regardless of the current modifications.

Everything seems to be good on modifying the table, no error messages. After
the modifications the second table isn't modified at all. Should anybody
suggest me what I'm doing wrong? Does a trigger functon send error messages
if it fails?

My statements:
--------------
CREATE OR REPLACE FUNCTION trg_upd_prod_instock() RETURNS trigger AS '
BEGIN
  perform ''update t_products set
getup_instock=get_stock_getup(''||quote_literal(NEW.productid)||'',1) where
id=''||quote_literal(NEW.productid);
  RETURN NEW;
END;
' LANGUAGE plpgsql;

GRANT ALL ON FUNCTION trg_upd_prod_instock() TO public;

CREATE TRIGGER t_stockchanges_trigger AFTER INSERT OR UPDATE OR DELETE ON
t_stockchanges
    FOR EACH ROW EXECUTE PROCEDURE trg_upd_prod_instock();

Many thanks,
  -- Csaba Együd

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.707 / Virus Database: 463 - Release Date: 2004. 06. 15.



Responses

pgsql-general by date

Next:From: ScrappyDate: 2004-06-26 20:01:04
Subject: Re: Incoming Msg
Previous:From: Aaron BurghardtDate: 2004-06-26 17:21:33
Subject: enable thready safety on Mac OS X 10.3.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group