Re: Trigger position

Поиск
Список
Период
Сортировка
От Marcos Pegoraro
Тема Re: Trigger position
Дата
Msg-id CAB-JLwZoeig2KdZvREA=96-humAAiGMBHkfLTwCz1yQLQm9aFw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Trigger position  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
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 trigger names have same names as their functions, so for this table I have to have a different name just to be fired first.


Em qua., 15 de set. de 2021 às 10:51, Alvaro Herrera <alvherre@alvh.no-ip.org> escreveu:
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 add lines in between you have some room to do so.
(This happens when modifying a program sufficient times you are forced
to renumber old lines where you want to add new lines that no longer fit
in the sequence.)  It's a pretty bad system.

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 be fine; you can do
"AAB_oops_really_second" afterwards, and so on.  The integer numbering
system doesn't seem very useful/flexible when seen in this light.

--
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
"Nunca confiaré en un traidor.  Ni siquiera si el traidor lo he creado yo"
(Barón Vladimir Harkonnen)

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Hook for extensible parsing.
Следующее
От: "Euler Taveira"
Дата:
Сообщение: Re: Trigger position