Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCHs3-0001En-2e for pgsql-admin@arkaria.postgresql.org; Tue, 16 Oct 2018 05:26:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gCHs0-0000Xb-BI for pgsql-admin@arkaria.postgresql.org; Tue, 16 Oct 2018 05:26:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCHrz-0000XS-Pq for pgsql-admin@lists.postgresql.org; Tue, 16 Oct 2018 05:26:15 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gCHrs-0004EL-F0 for pgsql-admin@postgresql.org; Tue, 16 Oct 2018 05:26:14 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 172A6FBDCED1 for ; Mon, 15 Oct 2018 22:26:07 -0700 (MST) Date: Mon, 15 Oct 2018 22:26:07 -0700 (MST) From: pavan95 To: pgsql-admin@postgresql.org Message-ID: <1539667567051-0.post@n3.nabble.com> In-Reply-To: <81cfab86-c6dc-89a1-5685-7589e4f81f9d@catalyst.net.nz> References: <1539447741900-0.post@n3.nabble.com> <20427d4e-98a5-0cda-bddc-070989015cca@catalyst.net.nz> <1539598263562-0.post@n3.nabble.com> <81cfab86-c6dc-89a1-5685-7589e4f81f9d@catalyst.net.nz> Subject: Re: Hick ups in Postgresql Logical Replication MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >With respect to the question about wal files and LSN, see the function pg_walfile_name(), e.g: >postgres=# SELECT pg_current_wal_lsn(); > pg_current_wal_lsn >-------------------- > 0/51EB3BA8 >(1 row) >postgres=# SELECT pg_walfile_name(pg_current_wal_lsn()); > pg_walfile_name >-------------------------- > 000000010000000000000051 >(1 row) Hi Mark, My question was like how to get all the LSN's that are available in a WAL segment. For example, take a segment named "000000010000000000000051". So in the above archive log segment, how to get all the LSN's of all txn's which belong to that segment ? *The idea for asking this is, I will get the remote_lsn on the subscriber which was successfully applied from the view "pg_replication_origin_status". Based on the LSN, I will check in which archive segment that particular LSN is present(as you said above). And will find all the later LSN's(later to remote_lsn). So I can say that these many transactions are yet to be applied to the target.* Regards, Pavan, 9841380956 -- Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html