Re: Rules and Triggers: another question

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Jerome Chochon" <jerome(dot)chochon(at)ensma(dot)fr>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Rules and Triggers: another question
Date: 2002-09-12 12:52:47
Message-ID: 007201c25a5b$4c513770$4201a8c0@beeblebrox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jerome Chochon wrote:

> Thanks for your answer but i have another 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, whichone will call the value the first ?
>
> Someone can help me ??

With the RULE, the function will be called earlier than with the TRIGGER.
(according to what Ross said before)

Regards,
Michael

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gaetano Mendola 2002-09-12 13:09:53 Select the max on a field
Previous Message Michael Paesold 2002-09-12 10:28:50 Re: reset sequence