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 1kTSW6-0001yh-SH for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Oct 2020 16:23:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kTSW5-0003WS-OG for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Oct 2020 16:23:41 +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 1kTSW5-0003WK-Hj for pgsql-hackers@lists.postgresql.org; Fri, 16 Oct 2020 16:23:41 +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 1kTSW3-0000S4-FU for pgsql-hackers@lists.postgresql.org; Fri, 16 Oct 2020 16:23:41 +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 09GGNTG34157149; Fri, 16 Oct 2020 12:23:30 -0400 From: Tom Lane To: Alvaro Herrera cc: Bruce Momjian , Julien Rouhaud , Robert Haas , Michael Paquier , torikoshia , Atsushi Torikoshi , Tatsuro Yamada , Tomas Vondra , Evgeny Efimkin , PostgreSQL Hackers Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? In-reply-to: <20201016160355.GA31474@alvherre.pgsql> References: <20201016160355.GA31474@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 16 Oct 2020 13:03:55 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4157147.1602865409.1@sss.pgh.pa.us> Date: Fri, 16 Oct 2020 12:23:29 -0400 Message-ID: <4157148.1602865409@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > In this case, I suppose using pg_stat_statement would require to have it > enabled, and it'd just not collect anything if disabled. Alternatively, pg_stat_statement might be able to force it on (applying a non-overridable PGC_INTERNAL-level setting) on load? Not sure if that'd be desirable or not. If the behavior of pg_stat_statement is to do nothing when it sees a query without the ID calculated (which I guess it'd have to) then there's a potential security issue if the GUC is USERSET level: a user could hide her queries from pg_stat_statement by turning the GUC off. So this line of thought suggests the GUC needs to be at least SUSET, and maybe higher ... doesn't pg_stat_statement need it to have the same value cluster-wide? regards, tom lane