Re: Controling Rule's Firing Order

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Controling Rule's Firing Order
Дата
Msg-id Pine.LNX.4.44.0208232119300.4273-100000@cm-lcon1-46-187.cm.vtr.net
обсуждение исходный текст
Ответ на Re: Controling Rule's Firing Order  (cn <cnliou@eurosport.com>)
Список pgsql-general
cn dijo:


> > Foreign key triggers will fire in alphabetical order along with other triggers.
> > This means they're firing based on a textual sort of the OIDs assigned to the
> > triggers, which will often but not always correspond to creation order.
>
> I don't fully understand the meaning of the term "firing in alphabetic
> order" you mentioned earlier and "they're firing based on a textual sort
> of the OIDs assigned to the triggers". OIDs are integers. Why terms
> "textual" and "alphabetic" are used?  Did you actually referring them to
> the _names_ of triggers, rules, and FK triggers, instead of their OIDs?

Foreign key constraints are implemented internally with triggers.  Those
triggers are named after the foreign key that they serve, and that name
contains the OID that is apparently the only means of distinguishing
from others FK triggers (on the same table?).  The firing order of
foreign key is thus the firing order of the trigger, which is by OID (by
the OID their name contains).

I unfortunatly just broke my copy of Postgres so cannot show you an
example, but try looking at the names of the triggers inside your
database (yes, system catalog poking is a very interesting exercise).

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Las cosas son buenas o malas segun las hace nuestra opinion" (Lisias)


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Controling Rule's Firing Order
Следующее
От: Steve Lane
Дата:
Сообщение: Why is pgbench suddenly slow?