Triggers in postgres

From: Rob <rob(at)obsidian(dot)co(dot)za>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Triggers in postgres
Date: 2002-03-19 16:40:20
Message-ID: Pine.LNX.4.33L2.0203191140010.7143-100000@Genesis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I have a product table with a column barcode. After a product has been
deleted, I want to create a trigger to delete references to that product
in other tables. I've got the following trigger

CREATE TRIGGER
AFTER DELETE
ON TABLE product
FOR EACH ROW

Now, what I would ideally like to do is issue a simple sql delete command,
but I think I actually have to define a function (is this true?). Say I
do, then the rest of my trigger would look like

EXECUTE PROCEDURE someProc();

Now I need to pass somProc the barcode of the product I've just deleted.
How do I do this?

Thanks

Rob

--
He who dies with the most toys ...

... still dies

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jason Earl 2002-03-19 17:02:17 Re: Fwd: Query results
Previous Message Stein Eldar Johnsen 2002-03-19 15:28:23 undefined reference to `PgConnection type_info function'