Re: Application user name attribute on connection pool

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: Application user name attribute on connection pool
Дата
Msg-id AANLkTin+T4ZWGzLGfLg+KDeuTiQeWQXbgsfYuqx2BySG@mail.gmail.com
обсуждение исходный текст
Ответ на Application user name attribute on connection pool  (<rsmogura@softperience.pl>)
Список pgsql-general
On Mon, Aug 2, 2010 at 07:30,  <rsmogura@softperience.pl> wrote:
> Hello,
>
> I'm not member of this list, but because the 9th version of PostgreSQL is
> incoming, I would like to ask if there is possibility to add session
> property of application user

Not for 9.0 its more or less already cut.

> - this property, in contrast to login name,
> should be setted by driver (e.g. JDBC) to current user logged into
> application server. This for example, will allow triggers to store real
> user name in history tables or log subsystem (in future) to write who
> deleted this or that. Similarly solution is in Oracle.

You might be able to (ab)use the new application_name GUC, see
http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html#GUC-APPLICATION-NAME.

I have used custom GUCS, per session temporary tables and giving each
user an actual database 'role' for this in the past.  Any of those
with appropriate triggers works fairly well.  I find normally you end
up needing a temp table anyways as you end up wanting to log more than
just the user (for me its the "page_load" or the "action").

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

Предыдущее
От: Felipe de Jesús Molina Bravo
Дата:
Сообщение: solaris slow
Следующее
От: Jason Dixon
Дата:
Сообщение: Register now for Surge 2010