Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 6DAB6133655C for ; Tue, 4 Jan 2011 04:12:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 21172-07 for ; Tue, 4 Jan 2011 08:12:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id A474D13364DE for ; Tue, 4 Jan 2011 04:12:49 -0400 (AST) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p048CmTr016155 for ; Tue, 4 Jan 2011 10:12:48 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p048ClYE016153 for pgsql-admin@postgresql.org; Tue, 4 Jan 2011 10:12:47 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-admin@postgresql.org Subject: Re: SET SESSION AUTHORIZATION and log file entries Date: Tue, 4 Jan 2011 10:12:46 +0200 User-Agent: KMail/1.9.7 References: <201012291606.41505.achill@matrix.gatewaynet.com> In-Reply-To: <201012291606.41505.achill@matrix.gatewaynet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201101041012.47556.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.451 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201101/23 X-Sequence-Number: 36463 =D3=F4=E9=F2 Wednesday 29 December 2010 16:06:41 =EF/=E7 Achilleas Mantzios= =DD=E3=F1=E1=F8=E5: > Hello, > i noticed that the user name as displayed in the postgresql log (specifie= d 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"=20 > but, instead, shows the initial user which first authenticated against th= e 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 a= chieve 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 cred= entials 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 al= lowed 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 init= ial 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 su= perpool 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 desirabl= e and missing from=20 the current solutions available. In the case of a more simple web environment, that might not be smth very i= mportant, but in business environment, having each user reported separately in the po= stgresql side, i think, would be very good to have. > --=20 > Achilleas Mantzios >=20 =2D-=20 Achilleas Mantzios