Re: Rules and Triggers: another question - Mailing list pgsql-sql

From Michael Paesold
Subject Re: Rules and Triggers: another question
Date
Msg-id 007201c25a5b$4c513770$4201a8c0@beeblebrox
Whole thread Raw
In response to Re: Rules and Triggers  ("Adam Erickson" <adamre@cox.net>)
List 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



pgsql-sql by date:

Previous
From: "Michael Paesold"
Date:
Subject: Re: reset sequence
Next
From: "Gaetano Mendola"
Date:
Subject: Select the max on a field