Re: Audtiting, DDL and DML in same SQL Function

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Audtiting, DDL and DML in same SQL Function
Дата
Msg-id CAEZATCXkOW7TYHS1qUyAovFRjj6Z1fqhjDTvxELHQChUK=6DMQ@mail.gmail.com
обсуждение исходный текст
Ответ на Audtiting, DDL and DML in same SQL Function  (Christian Ramseyer <rc@networkz.ch>)
Список pgsql-general
On 1 February 2012 22:29, Christian Ramseyer <rc@networkz.ch> wrote:
> Hello list
>
> I'm trying to build a little trigger-based auditing for various web
> applications. They have many users in the application layer, but they
> all use the same Postgres DB and DB user.
>
> So I need some kind of session storage to save this application level
> username for usage in my triggers, which AFAIK doesn't exist in
> Postgres. Googling suggested to use a temporary table to achieve
> something similar.
>
> Question 1: Is this really the right approach to implement this, or are
> there other solutions, e.g. setting application_name to user@application
> and using this in the triggers or similar workarounds?
>

There's an example in the manual of another way to keep
session-specific data:
http://www.postgresql.org/docs/current/static/plperl-global.html

You can do similar things in other procedural languages too, just not
in PL/pgSQL.

Regards,
Dean

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

Предыдущее
От: Venkat Balaji
Дата:
Сообщение: Re: [GENERA]: Postgresql-9.1.1 synchronous replication issue
Следующее
От: Saurabh
Дата:
Сообщение: Facing issue in online recovery of pgpool-II