Re: Trigger position - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Trigger position
Date
Msg-id 202109151351.ds3s5qdazao2@alvherre.pgsql
Whole thread Raw
In response to Re: Trigger position  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: Trigger position
Re: Trigger position
List pgsql-hackers
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 by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: On login trigger: take three
Next
From: Jim Mlodgenski
Date:
Subject: Re: Hook for extensible parsing.