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_in stock() RETURNS trigger AS '
BEGIN
perform ''update t_products set
getup_instock=g et_stock_getup( ''||quote_liter al(NEW.producti d)||'',1) where
id=''||quote_li teral(NEW.produ ctid);
RETURN NEW;
END;
' LANGUAGE plpgsql;
GRANT ALL ON FUNCTION trg_upd_prod_in stock() TO public;
CREATE TRIGGER t_stockchanges_ trigger AFTER INSERT OR UPDATE OR DELETE ON
t_stockchanges
FOR EACH ROW EXECUTE PROCEDURE trg_upd_prod_in stock();
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.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster