Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tNDJL-009MI9-7s for pgsql-admin@arkaria.postgresql.org; Mon, 16 Dec 2024 15:47:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tNDJI-008Fnx-Pw for pgsql-admin@arkaria.postgresql.org; Mon, 16 Dec 2024 15:47:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tNDJI-008FnS-DJ for pgsql-admin@lists.postgresql.org; Mon, 16 Dec 2024 15:47:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tNDJH-003APv-JA for pgsql-admin@lists.postgresql.org; Mon, 16 Dec 2024 15:47:05 +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 4BGFl1Yl1976973; Mon, 16 Dec 2024 10:47:01 -0500 From: Tom Lane To: Fabrice Chapuis cc: pgsql-admin@lists.postgresql.org Subject: Re: pg_stat_statements_reset In-reply-to: References: Comments: In-reply-to Fabrice Chapuis message dated "Mon, 16 Dec 2024 16:30:39 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1976971.1734364021.1@sss.pgh.pa.us> Date: Mon, 16 Dec 2024 10:47:01 -0500 Message-ID: <1976972.1734364021@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fabrice Chapuis writes: > This query seems not resetting stats for databae mydb > SELECT pg_stat_statements_reset( > NULL, -- userid: NULL means "all users" > (SELECT oid FROM pg_database WHERE datname = 'mydb'), > NULL -- queryid: NULL means "all queries" > ); Where did you get the idea that NULL means "all"? AFAICS that function is strict, meaning it won't run at all for null input. regards, tom lane