Rules and Triggers: another question

From: "Jerome Chochon" <jerome(dot)chochon(at)ensma(dot)fr>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Rules and Triggers: another question
Date: 2002-09-16 06:57:37
Message-ID: 012c01c25d4e$57791320$80a337c1@pclisi17
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all.

Sorry to ask you another time this question.

Which one is the faster ?

If i write this trigger...
CREATE TRIGGER trigger_name
BEFORE DELETE
ON table_name
FOR EACH ROW EXECUTE PROCEDURE function();

and this rule:
CREATE RULE name_rule AS
ON DELETE TO table_name
DO select function();

When i delete values, which one will call the function the first ?

Someone can help me ??

And if I want to use only function, do I use Trigger or Rules ?

(Thanks to M. Michael Paesold to answer my question but I want another answer to be sure)

Best Regards.

Jérêom Chochon

Browse pgsql-sql by date

  From Date Subject
Next Message Florian Mader 2002-09-16 08:29:13 Re: Timestamp Fractions Problem
Previous Message Bruce Momjian 2002-09-16 04:03:32 Re: Table alias in DELETE statements