Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9BA20476091 for ; Thu, 12 Sep 2002 08:51:13 -0400 (EDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 758E0475F0B for ; Thu, 12 Sep 2002 08:51:12 -0400 (EDT) Received: (qmail 22155 invoked by uid 0); 12 Sep 2002 12:51:15 -0000 Received: from chello062178186201.1.15.tuwien.teleweb.at (HELO beeblebrox) (62.178.186.201) by mail.gmx.net (mp014-rz3) with SMTP; 12 Sep 2002 12:51:15 -0000 Message-ID: <007201c25a5b$4c513770$4201a8c0@beeblebrox> From: "Michael Paesold" To: "Jerome Chochon" Cc: References: <007c01c25902$9772b940$4201a8c0@beeblebrox> <20020910232816.GA3983@rice.edu> <002101c25964$e5e4e460$4201a8c0@beeblebrox> <013e01c25a5a$4c094e70$80a337c1@pclisi17> Subject: Re: Rules and Triggers: another question Date: Thu, 12 Sep 2002 14:52:47 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/96 X-Sequence-Number: 9373 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