Re: What Is The Firing Order?
От | Stephan Szabo |
---|---|
Тема | Re: What Is The Firing Order? |
Дата | |
Msg-id | Pine.BSF.4.21.0109071100350.99448-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Re: What Is The Firing Order? (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: What Is The Firing Order?
|
Список | pgsql-general |
On Fri, 7 Sep 2001, Bruce Momjian wrote: > > > Should we get a system where the user can control the firing, perhaps > > > using oid order? > > > > I don't think oid order would help, because what happens if you've say got > > a trigger and then want to add another before it? I'd guess the most > > general way would be to give triggers some kind of numeric ordering not > > associated with anything else, but then you need ways to set it on create > > trigger and probably an alter trigger way to change it. :( I'd guess that > > there'd be a default value if you didn't set it, and that triggers of the > > same value would run in indeterminate order like before. > > Yes, the problem with alphabetical order is that mere creation of a > trigger would change the firing order. I was thinking oid order so > there is some stability to the system for people who don't care about > the order, and a way to control it for people who need to (create > triggers in desired order). The alphabetical ordering would change the order, but only with respect to the new constraint and existing ones not between the existing ones. The advantage here is that making a trigger fire before an existing one is easy, since you can name before it. The oid ordering has the property that the triggers would by default run in creation order. Creating a new trigger would always put it at the end unless you've wrapped oids which is nicer than having to worry about interactions between the new trigger and existing ones based on where it is (although you have to do that now), however putting a trigger before an existing one means dropping and recreating one or more of your existing triggers... all of the ones from where you want to put it in the order to the last one.
В списке pgsql-general по дате отправления: