Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5DVR-0001wc-3D for pgsql-admin@arkaria.postgresql.org; Mon, 20 Jan 2014 11:59:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W5DVQ-0002KE-Jw for pgsql-admin@arkaria.postgresql.org; Mon, 20 Jan 2014 11:59:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4Eub-0004cE-GF for pgsql-admin@postgresql.org; Fri, 17 Jan 2014 19:17:01 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4EuY-0003oZ-Eg for pgsql-admin@postgresql.org; Fri, 17 Jan 2014 19:17:01 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1W4EuV-0003b3-K0 for pgsql-admin@postgresql.org; Fri, 17 Jan 2014 11:16:55 -0800 Date: Fri, 17 Jan 2014 11:16:55 -0800 (PST) From: yhe To: pgsql-admin@postgresql.org Message-ID: <1389986215594-5787682.post@n5.nabble.com> Subject: strem replication standby lag check MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 2.0 (++) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org hi, all, I know we can connect to primary and SELECT pg_current_xlog_location(); (eg. '0/36A77900') to get primary xlog position then connect to the standby to do the following to get the byte lag: select pg_xlog_location_diff('0/36A77900',pg_last_xlog_replay_location()); 0/36A77900 is the xlog position from primary. My question is that is there a way I can connect to the primary on the standby host using replica user which i already have the primary_conninfo in the recovery.conf and get the result of SELECT pg_current_xlog_location(); of the primary so I can simply write a function on the standby to return the lag in bytes in one call. any way I can do that without a dblink? Thank you if any one can help. best, Ying -- View this message in context: http://postgresql.1045698.n5.nabble.com/strem-replication-standby-lag-check-tp5787682.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com. -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin