Re: Trigger position

From: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Trigger position
Date: 2021-09-15 12:49:17
Message-ID: CAB-JLwZWf3yim6ACer9G_=dmzYOBP4Or-6T71QBmfQRVcxpUcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 <andreas(at)proxel(dot)se>
escreveu:

> On 9/15/21 1:40 PM, Tom Lane wrote:
> > Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> 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, which I like it more.
> >
> > Color me skeptical: doesn't that introduce more complication without
> > fundamentally solving anything? You still don't know which position
> > numbers other triggers have used, so it seems like this is just a
> > different way to spell the same problem.
>
> I guess one advantage is that it would make the intent of the DDL author
> more clear to a reader and that it also makes it more clear to people
> new to PostgreSQL that trigger order is something that is important to
> reason about.
>
> If those small advantages are worth the complication is another question
> (I am skpetical), but if we would implement this I prefer the Firebird
> solution over the Oralce/MSSQL solution since the Firebird solution is
> simpler while achieving the same thing plus that the Firefird solution
> seems like it would be obviously backwards compatible with our current
> solution.
>
> Andreas
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-09-15 12:56:04 Release 14 Schedule
Previous Message Daniel Gustafsson 2021-09-15 12:47:11 Re: SSL/TLS instead of SSL in docs