pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paesold <mpaesold@gmx.at>
To: Jerome Chochon <jerome.chochon@ensma.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: Rules and Triggers: another question
Date: Thu, 12 Sep 2002 14:52:47 +0200
Message-ID: <007201c25a5b$4c513770$4201a8c0@beeblebrox> (raw)
References: <ALEKKHACBIAEBNBPFKPCGEJNEKAA.adamre@cox.net>
	<007c01c25902$9772b940$4201a8c0@beeblebrox>
	<20020910232816.GA3983@rice.edu>
	<002101c25964$e5e4e460$4201a8c0@beeblebrox>
	<013e01c25a5a$4c094e70$80a337c1@pclisi17>

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




view thread (2+ messages)  latest in thread

Message-ID: <007201c25a5b$4c513770$4201a8c0@beeblebrox>
Permalink:  ../007201c25a5b$4c513770$4201a8c0@beeblebrox/
Also on:    postgresql.org/message-id/007201c25a5b$4c513770$4201a8c0@beeblebrox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mpaesold@gmx.at, jerome.chochon@ensma.fr
  Subject: Re: Rules and Triggers: another question
  In-Reply-To: <007201c25a5b$4c513770$4201a8c0@beeblebrox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox