Re: audit information

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: audit information
Дата
Msg-id 2336.1114529517@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: audit information  ("Keith Worthington" <keithw@narrowpathinc.com>)
Список pgsql-novice
"Keith Worthington" <keithw@narrowpathinc.com> writes:
> I have created the following function to create the necessary data for my
> audit trail.  Unfortunately I do not know how I can test it without putting
> the whole modification in place. (This is a small part of a much bigger project.)

> Can anyone suggest how to test this functionality without implementing it as a
> trigger on a table?

You can't.  But you could make a test table and install the function as
a trigger on that.

> Can this function be implemented as STABLE STRICT?

Nope.  STRICTness is meaningless anyway for a trigger, since it has no
explicit arguments to be strict about.  And triggers are always volatile
since the entire point is to have side-effects.  In the current code I
am not sure whether it matters if you try to mark a trigger function
stable ... but if the system were actually to enforce the STABLE
restrictions against your function, you'd not like the result.  Some day
it probably will enforce them...

            regards, tom lane

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

Предыдущее
От: "Keith Worthington"
Дата:
Сообщение: Re: audit information
Следующее
От: "Keith Worthington"
Дата:
Сообщение: Re: Poor-man's enumeration type