Re: Two rules on a view do not like each other :-( - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: Two rules on a view do not like each other :-(
Date
Msg-id 3FC11551.10308@bigfoot.com
Whole thread Raw
In response to Re: Two rules on a view do not like each other :-(  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Two rules on a view do not like each other :-(  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:

> Dima Tkach <dmitry@openratings.com> writes:
>
>>Also, have anything similar been done in 7.3 regarding the order in
>>which *triggers* are executed.
>
>
> Yes --- by name.

Why not implement in SQL standard way ?
I'm against this alphabetic order firing.

I's not safe develop a new trigger and completely change
the trigger firing order. Suppose that I want multiply for
2 a field of a table for each insert. What happen if that field
is manipulated already by another trigger calculating let me say:
sqrt ?

Before my new trigger:

Only first trigger:
   insert a -> insert sqrt(a)

and I want:

first + second trigger:

   insert a -> insert sqrt(a) -> insert 2*sqrt(a)

if my trigger name is aaaaaaa

   insert a -> insert 2*a -> insert sqrt( 2*a )


What shall I do to be safe ? Name my trigger zzzzzzz ?



I think is more natural that my last trigger developped is the last
to be fired.


Regards
Gaetano Mendola



pgsql-general by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: First generic/redhatish RPM's uploaded to ftp.postgresql.org.
Next
From: Tom Lane
Date:
Subject: Re: Two rules on a view do not like each other :-(