We can run triggers using position only, this way we don´t have these few
cycles to determine ordering.
On creation time we populate position, even if it's not set, so for the
first time position will match trigger names. When user changes a trigger
position we sum 1 to the followers.
re
On 09/15/21 06:28, Marcos Pegoraro wrote:
> Oracle and SQL Server have FOLLOWS and PRECEDES when defining trigger
> execution order. Firebird has POSITION, which I like it more.
Between those two, I think my vote would come down the other way,
assuming FOLLOWS and PRECEDES work the way I am guess
On 2021-Sep-15, Pavel Stehule wrote:
> Triggers that depend on execution order are pretty hell. It is a clean
> signal of some crazy design and overusing of triggers.
Yeah. The only case I've seen where order of triggers was important
(beyond the "before" / "after" classification) is where you h
st 15. 9. 2021 v 17:14 odesílatel Euler Taveira napsal:
> On Wed, Sep 15, 2021, at 10:51 AM, Alvaro Herrera wrote:
>
> In a computer system, alphabet letters are just a different way to
> present numbers, so you just choose ASCII letters that match what you
> want. You can use "AA_first_trigger"
On Wed, Sep 15, 2021, at 10:51 AM, Alvaro Herrera wrote:
> In a computer system, alphabet letters are just a different way to
> present numbers, so you just choose ASCII letters that match what you
> want. You can use "AA_first_trigger", "BB_second_trigger",
> "AB_nope_this_is_second" and you'll b
When I was writing my initial email I was remembering exactly this, my
first basic programs.
I would like this feature more because I sometimes have a mess of triggers
when this trigger function is fired on several tables and it needs to be
the first on this table but not on that table. And usually
On 2021-Sep-15, Marcos Pegoraro wrote:
> This problem can raise ... there is a trigger foo using position 1, please
> choose another
This is reminiscent of the old BASIC programming language, where you
eventually learn to choose line numbers that aren't consecutive, so that
if you later have to a
Correct, we need a field tgposition on pg_trigger and when it´s null we
follow normal ordering
select * from pg_trigger where tgrelid = X and tgtype = Y order by
tgposition nulls last, tgname
regards,
Marcos
Em qua., 15 de set. de 2021 às 09:35, Andreas Karlsson
escreveu:
> On 9/15/21 1:40 PM,
On 9/15/21 1:40 PM, Tom Lane wrote:
Marcos Pegoraro writes:
Alphabetical order of triggers sometimes makes me write a_Recalc or z_Calc
to be sure it´ll be the first or the last trigger with same event of that
table
Oracle and SQL Server have FOLLOWS and PRECEDES when defining trigger
executi
This way would be interesting for those are migrating from these databases
too. But ok, I´ll forget it.
Em qua., 15 de set. de 2021 às 08:40, Tom Lane escreveu:
> Marcos Pegoraro writes:
> > Alphabetical order of triggers sometimes makes me write a_Recalc or
> z_Calc
> > to be sure it´ll be the
This problem can raise ... there is a trigger foo using position 1, please
choose another
Atenciosamente,
Em qua., 15 de set. de 2021 às 07:59, Daniel Gustafsson
escreveu:
> > On 15 Sep 2021, at 12:28, Marcos Pegoraro wrote:
>
> > CREATE TRIGGER RECALC_THAT BEFORE UPDATE POSITION 1 ON ORDER
Marcos Pegoraro writes:
> Alphabetical order of triggers sometimes makes me write a_Recalc or z_Calc
> to be sure it´ll be the first or the last trigger with same event of that
> table
> Oracle and SQL Server have FOLLOWS and PRECEDES when defining trigger
> execution order. Firebird has POSITION
> On 15 Sep 2021, at 12:28, Marcos Pegoraro wrote:
> CREATE TRIGGER RECALC_THAT BEFORE UPDATE POSITION 1 ON ORDERS...
> CREATE TRIGGER DO_OTHER_CALC BEFORE UPDATE POSITION 2 ON ORDERS...
For those not familiar with Firebird: triggers are executing in alphabetical
order within a position number,
Hi Hackers,
Alphabetical order of triggers sometimes makes me write a_Recalc or z_Calc
to be sure it´ll be the first or the last trigger with same event of that
table
Oracle and SQL Server have FOLLOWS and PRECEDES when defining trigger
execution order. Firebird has POSITION, which I like it more
14 matches
Mail list logo