Re: why is there no TRIGGER ON SELECT ?

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: why is there no TRIGGER ON SELECT ?
Дата
Msg-id 944362.71173.qm@web121820.mail.ne1.yahoo.com
обсуждение исходный текст
Ответ на Re: why is there no TRIGGER ON SELECT ?  ("David Johnston" <polobo@yahoo.com>)
Ответы Re: why is there no TRIGGER ON SELECT ?
Re: why is there no TRIGGER ON SELECT ?
Список pgsql-general
Dave and Dmitriy,

I know a function can be used, but the point is to log a table whenever "someone else" does a SELECT on it.

It cannot be depended on that a user will include that (or any specific function in a SELECT.  iow, when any user does "SELECT ... FROM tablex;" then logging should occur.

That cannot happen unless there a trigger of the form:
CREATE TRIGGER tg_log_table AFTER SELECT
ON tablex FOR EACH STATEMENT
EXECUTE PROCEDURE log_table();

And yes, I know access the to table is restricted, but that is also not the point. Suppose an application requires that a user/client be charged for each time they access certain data?

The point, and question is, not how to work around the problem, but rather, why cannot this functionality be implemented in triggerts and rules.

Melvin Davidson

Dmitriy

>Why not use function which returns table and wrap the
>logging (auditing) code in it ?

Because to use a trigger function, you need a trigger, and as previously stated, you cannot have a trigger on select. The same applies for a rule.

Melvin Davidson

 


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

Предыдущее
От: "Jaiswal Dhaval Sudhirkumar"
Дата:
Сообщение: Re: Mysql to Postgresql
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: why is there no TRIGGER ON SELECT ?