Re: ALTER TABLE RENAME fix

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ALTER TABLE RENAME fix
Дата
Msg-id 18241.1005450179@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ALTER TABLE RENAME fix  (Brent Verner <brent@rcfile.org>)
Ответы Re: ALTER TABLE RENAME fix  (Brent Verner <brent@rcfile.org>)
Список pgsql-patches
Brent Verner <brent@rcfile.org> writes:
> exactly. which is why we've gotta inspecy the relname to determine
> which of the attnames to modify.

My point is that inspecting the tgfoid is safer, because it
unambiguously tells you what you are looking at.  The relname is
inherently ambiguous because it could be the same on both sides.
Also, depending on the relname is highly fragile if you're trying
to handle the RENAME TABLE case --- did you already update (one
side of) this trigger, or not?

> right.  I was not proposing that as any bit of info to use, just an
> example that there is no useful way (in a pg_trigger scan) to know
> if the relname is a PK or FK rel.

There is: the tgfoid, which is indirectly the same way that the trigger
functions themselves know what to do.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ALTER TABLE RENAME fix
Следующее
От: Brent Verner
Дата:
Сообщение: Re: ALTER TABLE RENAME fix