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 1tFldH-00FmUu-0B for pgsql-general@arkaria.postgresql.org; Tue, 26 Nov 2024 02:48:55 +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 1tFldF-0039c9-6F for pgsql-general@arkaria.postgresql.org; Tue, 26 Nov 2024 02:48:53 +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 1tFldE-0039c1-Qn for pgsql-general@lists.postgresql.org; Tue, 26 Nov 2024 02:48:52 +0000 Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tFldC-003s2e-KU for pgsql-general@postgresql.org; Tue, 26 Nov 2024 02:48:52 +0000 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-29666708da7so3221750fac.0 for ; Mon, 25 Nov 2024 18:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732589328; x=1733194128; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OFG53PI10ysFcBczGJBFSX2aHzp5BmUzqtDvWZ7OXwI=; b=QIsTJEdxDueui5dkC9Vy8dou7NZk8Px5OeqKa0ZQ9WyL3LGvpa8AFPKJzji+3Nxgbe ECV8WTxkxegw+dQYs5Lzr+yC6JFPkaXfI8dp/EGEYRh5S7cJat/dd5JWXkRAdXT1R5bk t2NKOM1+Urate/XG6xV65jFtrfcgT8eEVzV8iDjkgdK25rhBwED8upN8PTuCmIsvpk4X 5MavvlDG3aEmv6ecHW7udYhk7UWTK040MHrJhLNu8UtrWi1TUlOhrqojfdJUctPFJNTL YlQfit3fKSj4PPiWtjziJcFud0IW9J5Y7G1Wr7HEFV9Xf/O9AmY1MKaaU1FDX3JXMgkc cHpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732589328; x=1733194128; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OFG53PI10ysFcBczGJBFSX2aHzp5BmUzqtDvWZ7OXwI=; b=KUlnfIWpqk5edpvTVfIFdGJDNdiQBN6kUeMqHWYjEntrOWTEIpPN/Y/AfPy+Ly1eEf gLgNT8RMM4wkBGOnIS+LKJklDYPpHEw2vqZ2+xWVCfbMZVfeNZ29ogdZ2DjEfx1M4IKn yUDPtlLdV0PxdTqAiIIVL/mkQJMf806OsF6kEp/L8h4aFL6Fb2jAAWv2xBm3VxiugaFL mb5GXad6eEuf2Ax6QGmQdl3tZB3yk2ta8hG0Naa8nPTZxvwiSPPKYT+4ehJY/ol3pz1j d2ur71cSlyOpNYZBfa1C43nA13rt9sYr/h0GNmPNh9cpXn6H23qKNRdn1BQbXGLAuD5g kb0A== X-Forwarded-Encrypted: i=1; AJvYcCUuLI1iadkeWeySq5SnssiFVO0pjkcvUtEh3RyO7G1jcBP+cErajtGwzzYgT/DlBrGiIu+F7VkqMC3c228L@postgresql.org X-Gm-Message-State: AOJu0Yw/vbFrD9V/uqUIe87Eez1uEhnH9XswLbX0HlqsE/3CR93n/koZ TWRVindTyaIQq288dF3eupdA8kyhdn+XlVrqrbpuQ+tCyZviyNdhprKvs2DZpvkKsNl8Ftg8PPs wqe6FsIHdjuEb4ZLC0mRgMEkY8goDfjgu X-Gm-Gg: ASbGnctbBxWe1pxaXLDHIbs7bFdt8VW9ClowGDLg4QsSAUht9MhupcFeH44k4oHBqcD lxsuYElXFE2fSiwpTxWYJ6mTZEfxGIqI= X-Google-Smtp-Source: AGHT+IFtMr/E+Al6pLVOebLWJMnxiJTOte6QYnlmMyVmlDIwVsKiLNeGfmLCZP9BV+bvkD/Y+FceVAf10XQ5DmtUiCw= X-Received: by 2002:a05:6870:391f:b0:296:dd1d:ce5a with SMTP id 586e51a60fabf-29720adbc09mr10939780fac.3.1732589328508; Mon, 25 Nov 2024 18:48:48 -0800 (PST) MIME-Version: 1.0 References: <6a157286-5948-48ac-bc50-7bb4e65ee5e5@aklaver.com> <38725031-5e80-46ee-b403-a92107b24c39@aklaver.com> <1e2db3f5-00f4-4ec2-800f-46136c2fad59@aklaver.com> <1270021b-c5b5-4ca8-b48d-7dfb163bb6f7@aklaver.com> <9a0d0e80-13e1-421a-9d84-da000fe4433a@aklaver.com> <01020193592431ad-0fedca70-38e9-4fd0-bf49-f5bbf628c76e-000000@eu-west-1.amazonses.com> In-Reply-To: From: Steeve Boulanger Date: Mon, 25 Nov 2024 20:48:38 -0600 Message-ID: Subject: Re: Database stats ( pg_stat_database.stats_reset ) get reset on daily basis - why? To: Greg Sabino Mullane Cc: "Ray O'Donnell" , Adrian Klaver , pgsql-general Content-Type: multipart/alternative; boundary="00000000000077b1ea0627c7e395" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000077b1ea0627c7e395 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > As a superuser, rename pg_stat_reset inside one of the commonly affected databases: > alter function pg_stat_reset rename to hey_stop_running_pg_stat_reset_already; > Then see who starts complaining. Additionally, your server log will get helpful entries like this: Thanks for the tip Greg - that's very clever! I've done this just now, and will check back tomorrow to see if there's any corresponding error message. NB: I hadn't originally realized that the system functions (ie pg_*) were created for each database, so I had renamed only the one in the postgres database, thinking it was global (ie I'll blame this on my Oracle days ;-)). Now I renamed the function under one database that had been verified as getting its stats reset on a daily basis. Hopefully tomorrow we'll get more interesting info! -Steeve On Sat, Nov 23, 2024 at 11:50=E2=80=AFAM Greg Sabino Mullane wrote: > As a superuser, rename pg_stat_reset inside one of the commonly affected > databases: > > alter function pg_stat_reset rename to > hey_stop_running_pg_stat_reset_already; > > Then see who starts complaining. Additionally, your server log will get > helpful entries like this: > > ERROR: function pg_stat_reset() does not exist > > Cheers, > Greg > > --00000000000077b1ea0627c7e395 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>=C2=A0 As a superuser, rename pg_stat_reset inside one of the commonly affected da= tabases:
> alter function pg_stat_reset rename to hey_stop_running_p= g_stat_reset_already;
> Then see who starts complaining. Addit= ionally, your server log will get helpful entries like this:

=
Thanks=C2=A0for the tip Greg - that's very clever! I've = done this just now, and=C2=A0will check back tomorrow to see if there's= any corresponding error message.=C2=A0

NB:=C2=A0 = I hadn't originally realized that the system functions (ie pg_*) were c= reated for each database, so I had renamed only the one in the postgres dat= abase, thinking it was global (ie I'll blame this on my Oracle days ;-)= ).=C2=A0

Now I renamed the function under one data= base that had been verified as getting its stats reset on a daily basis. Ho= pefully tomorrow we'll get more interesting info!=C2=A0

<= /div>
-Steeve

On Sat, Nov 23, 2024 at 11:50=E2=80=AFAM Greg Sabino= Mullane <htamfids@gmail.com&g= t; wrote:
As a superuser, rename pg_stat_reset inside one of the commonly = affected databases:

alter function pg_stat_reset rename = to hey_stop_running_pg_stat_reset_already;

Then se= e who starts complaining. Additionally, your server log will get helpful en= tries like this:

ERROR: =C2=A0function pg_stat_res= et() does not exist

Cheers,
Greg

--00000000000077b1ea0627c7e395--