Re: SET SESSION AUTHORIZATION and log file entries

Поиск
Список
Период
Сортировка
От Achilleas Mantzios
Тема Re: SET SESSION AUTHORIZATION and log file entries
Дата
Msg-id 201101041012.47556.achill@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на SET SESSION AUTHORIZATION and log file entries  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-admin
Στις Wednesday 29 December 2010 16:06:41 ο/η Achilleas Mantzios έγραψε:
> Hello,
> i noticed that the user name as displayed in the postgresql log (specified by %u) in the log_line_prefix
> does not show the user name of the effective user (current_user)as set by "SET SESSION AUTHORIZATION"
> but, instead, shows the initial user which first authenticated against the said connection.
> I think it would be better to have this user reported in the log files. (or have another entry e.g. %U to denote
that)

Also i noticed (in 9.0.2) that both SET SESSION AUTHORIZATION and SET ROLE do not reflect this change
in pg_stat_get_activity function, (and subsequently in the pg_stat_activity view).

I can imagine the use of either SET SESSION AUTHORIZATION and SET ROLE to achieve personalized
connections in a connection pool, without sucrificing any of the beneficial principles of having
a pool of equivalent connections.

I think having each user in an application connecting with his/her own credentials and authorizations
is a very good thing. Currently i am thinking of configuring smth like this in the jboss connection pool.
Unfortunately the current software only allows for subpools for each user, making the reuse and sharing of
connections impossible, but even if jboss and the postgresql jdbc driver allowed to do that
(via SET SESSION AUTHORIZATION or SET ROLE) then again the situation would not be complete
since the entries in the log and pg_stat_activity would still show the initial user who opened the connection.
(except there are other ways to change the current_user which i am missing).
I think, the combination of the two worlds (having both a generic single superpool of equivalent connections which
everybody could use, on one hand, and having the possibility of completetly personalizing connections
acquired from the pool according to the user of the application, having its name appearing in stats
and in log files as usesysid, on the other hand) is something both desirable and missing from
the current solutions available.

In the case of a more simple web environment, that might not be smth very important,
but in business environment, having each user reported separately in the postgresql side, i think,
would be very good to have.

> --
> Achilleas Mantzios
>



--
Achilleas Mantzios

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

Предыдущее
От: Imre Oolberg
Дата:
Сообщение: Re: Re: pg v. 8.4.5 misses objects and data after restoring from backup using wal
Следующее
От: Victor Hugo dos Santos
Дата:
Сообщение: ERROR: invalid memory alloc request size 4294967293