Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6Ez4-00061v-86 for pgsql-hackers@arkaria.postgresql.org; Sun, 31 Jan 2021 15:49:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6Ez1-0003aw-Ou for pgsql-hackers@arkaria.postgresql.org; Sun, 31 Jan 2021 15:49:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6Ez1-0003ao-I8 for pgsql-hackers@lists.postgresql.org; Sun, 31 Jan 2021 15:49:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6Eyv-0002jg-DC for pgsql-hackers@postgresql.org; Sun, 31 Jan 2021 15:49:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10VFnfxt3085086; Sun, 31 Jan 2021 10:49:42 -0500 From: Tom Lane To: Magnus Hagander cc: Jacob Champion , "sfrost@snowman.net" , "pgsql-hackers@postgresql.org" Subject: Re: Proposal: Save user's original authenticated identity for logging In-reply-to: References: <20210129220101.GE27507@tamriel.snowman.net> <2829030.1611959442@sss.pgh.pa.us> <2832058.1611963634@sss.pgh.pa.us> Comments: In-reply-to Magnus Hagander message dated "Sun, 31 Jan 2021 12:15:52 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3085084.1612108181.1@sss.pgh.pa.us> Date: Sun, 31 Jan 2021 10:49:41 -0500 Message-ID: <3085085.1612108181@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Magnus Hagander writes: > On Sat, Jan 30, 2021 at 12:40 AM Tom Lane wrote: >> I remain concerned about the cost and inconvenience of exposing >> it via log_line_prefix, but at least that shouldn't be visible >> to anyone who's not entitled to know who's logged in ... > What if we logged it as part of log_connection=on, but only there and > only once? It could still be traced through the rest of that sessions > logging using the fields identifying the session, and we'd only end up > logging it once. I'm certainly fine with including this info in the log_connection output. Perhaps it'd also be good to have a superuser-only column in pg_stat_activity, or some other restricted way to get the info from an existing session. I doubt we really want a log_line_prefix option. regards, tom lane