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 1wOx3x-000J2L-0j for pgsql-general@arkaria.postgresql.org; Mon, 18 May 2026 12:27:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wOx3u-002HhW-2E for pgsql-general@arkaria.postgresql.org; Mon, 18 May 2026 12:27:11 +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 1wOx3u-002HhO-0w for pgsql-general@lists.postgresql.org; Mon, 18 May 2026 12:27:11 +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 1wOx3t-00000000BXU-1Nyq for pgsql-general@lists.postgresql.org; Mon, 18 May 2026 12:27:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Reply-To: Message-ID:Subject:To:Sender:From:Date:Cc:Content-ID:Content-Description: In-Reply-To:References; bh=njCuCCx3ZVwfkeujBE39S67Kbz4vqOdbeNP4X8Y3vMY=; b=Q8 J78QVgDUANwa5rOGJOl8Mqa+Pnq6TdVv08Qg8Vd8xy1Hvf+tTNTm8ZxvDEqX6JMekTzF9e+V5eW1d m5qZSjhV+nqwuGUoI9WZz7oUkCmQDhXP1UAFbq68lsheN0+iTJOpk8yXhzfFP4Rbz+8bQwRNxS7yb rBEDmpcTS482LtI=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1wOx3s-007kri-06 for pgsql-general@lists.postgresql.org; Mon, 18 May 2026 14:27:08 +0200 Date: Mon, 18 May 2026 14:27:08 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: PostgreSQL General Subject: Is there any reason why pg_walfile_name() doesn't take timeline change into consideration? Message-ID: Reply-To: depesz@depesz.com MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I tried on a server that is on timeline 7 now, with .history being: 1 A9/5E0000A0 no recovery target specified 2 127/EB0000A0 no recovery target specified 3 127/F40000A0 no recovery target specified 4 128/170000A0 no recovery target specified 5 188/C70000A0 no recovery target specified 6 7B8/90000A0 no recovery target specified When I wal file that is "current", i get sensible filename: =# select pg_walfile_name('800/123'); pg_walfile_name ══════════════════════════ 000000070000080000000000 (1 row) But when I try to find walfile for old lsn, from older timeline, I'm getting bad results: =# select pg_walfile_name('125/123'); pg_walfile_name ══════════════════════════ 000000070000012500000000 (1 row) Timeline 7 was was "there" when wal lsn was 125/…. Is it just missing functionality, or am I missing something more complicated? Best regards, depesz