Re: Triggers and Schema's.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Triggers and Schema's.
Дата
Msg-id 13972.1034454407@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Triggers and Schema's.  (Steven Singer <ssinger@navtechinc.com>)
Ответы Re: Triggers and Schema's.  (Steven Singer <ssinger@navtechinc.com>)
Список pgsql-hackers
Steven Singer <ssinger@navtechinc.com> writes:
> I've been testing contrib/dbmirror with 7.3 and schema's and have come 
> across a problem.
> SPI_getrelname(tg_relation) can be used by a trigger to get the name of 
> the table that the trigger was fired on.  But that just gives the 
> tablename and not the schema that the table is in.  If you have a schema 
> named "A" and a schema named "B" each with an employee table how can a 
> trigger determine if it was fired on A.employee or B.employee.

You can doget_namespace_name(RelationGetNamespace(tg_relation))
Is this sufficiently useful to justify adding an SPI_getrelnamespace()
function?  I'm not very clear on the uses for SPI_getrelname().  Most
of the examples we have in contrib/ are using it for error messages,
which don't really need extra qualification IMHO.  The ones that are
interpolating the result into queries are for the most part demonstrably
wrong anyway, because they fail to consider the possible need for double
quotes.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 7.3b2 ?bug? bitfromint4 is not working
Следующее
От: Tom Lane
Дата:
Сообщение: \copy needs work (was Re: Changing Column Order)