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.96) (envelope-from ) id 1wm6SM-000aZU-2C for pgsql-general@arkaria.postgresql.org; Tue, 21 Jul 2026 09:08:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wm6SL-006Z2K-0A for pgsql-general@arkaria.postgresql.org; Tue, 21 Jul 2026 09:08:04 +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.96) (envelope-from ) id 1wm6SK-006Z2C-22 for pgsql-general@lists.postgresql.org; Tue, 21 Jul 2026 09:08:04 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wm6SI-00000000Pcu-047h for pgsql-general@lists.postgresql.org; Tue, 21 Jul 2026 09:08:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description; bh=fpX6G3Bea6J5PrIRJPcgfYoDo3c1oubodqvhSWL8bT0=; b=d8OvIrODj8RGIVR9K4juWy9BGZ kwzfdaua8UJA0j+LGQ362S1z3haKJothpVUcCCwUdUfZm5aRDB11eBHVGfKa0JABUnQJ3KDC3BIH5 3Z4P62DaahG5pk633cHRr+l4VABGO+M/NhStnCXwn8yxrzy7OCO+u7mZ+ZhpMeit4Z9s=; Received: from depesz by depesz.com with local (Exim 4.98.2) (envelope-from ) id 1wm6SG-0000000Cykc-1wFz; Tue, 21 Jul 2026 11:08:00 +0200 Date: Tue, 21 Jul 2026 11:08:00 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Bilal Abdulkadir Muhammed Cc: pgsql-general@lists.postgresql.org Subject: Re: Question about monitoring PostgreSQL 10 streaming replication health Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 20, 2026 at 05:23:07PM +0300, Bilal Abdulkadir Muhammed wrote: > I am monitoring a PostgreSQL 10 standby server using: > > pg_last_xlog_receive_location() > and > pg_last_xlog_replay_location() > > The current query only checks replay lag. I would like guidance on a more > comprehensive monitoring approach that can detect: > > 1. Standby disconnected from the primary. You can see this in https://pgdoc.link/pg_stat_replication@10 > 2. WAL receiver process stopped. Not sure how this is different than #1 > 3. Required WAL segment removed from the primary > (for example: "requested WAL segment has already been removed"). Check logs, and also check for existence of streaming. > I would like to know: > - Which SQL checks are recommended for these scenarios? > - Which conditions require external monitoring or log analysis? I would always monitor logs for errors. > - What is the recommended practice for monitoring PostgreSQL 10 streaming > replication health? The recommended practice is to upgrade. Pg 10 stopped being *supported* almost 4 years ago! Upgrade to something that is supported. Preferably newest possible (18 now, 19 by the end of this year). Best regards, depesz