From d497093cbecccf6df26365e06a5f8f8614b591c8 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 27 Dec 2022 08:27:53 +0900 Subject: pg_waldump: Add --save-fullpage=PATH to save full page images from WAL records This option extracts (potentially decompressing) full-page images included in WAL records into a given target directory. These images are subject to the same filtering rules as the normal display of the WAL records, hence with --relation one can for example extract only the FPIs issued on the relation defined. By default, the records are printed or their stats computed (--stats), using --quiet would only save the images without any output generated. This is a tool aimed mostly for very experienced users, useful for fixing page-level corruption or just analyzing the past state of a page, and there were no easy way to do that with the in-core tools up to now when looking at WAL. Each block is saved in a separate file, to ease their manipulation, with the file respecting ...._ with as format. For instance, 00000000-010000C0.1663.1.6117.123_main refers to: - WAL record LSN in hexa format (00000000-010000C0). - Tablespace OID (1663). - Database OID (1). - Relfilenode (6117). - Block number (123). - Fork name of the file this block came from (_main). Author: David Christensen Reviewed-by: Sho Kato, Justin Pryzby, Bharath Rupireddy, Matthias van de Meent Discussion: https://postgr.es/m/CAOxo6XKjQb2bMSBRpePf3ZpzfNTwjQUc4Tafh21=jzjX6bX8CA@mail.gmail.com --- doc/src/sgml/ref/pg_waldump.sgml | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_waldump.sgml b/doc/src/sgml/ref/pg_waldump.sgml index d559f091e5f..343f0482a9f 100644 --- a/doc/src/sgml/ref/pg_waldump.sgml +++ b/doc/src/sgml/ref/pg_waldump.sgml @@ -240,6 +240,72 @@ PostgreSQL documentation + + + + + Save full page images found in the WAL records to the + save_path directory. The images saved + are subject to the same filtering and limiting criteria as the + records displayed. + + + The full page images are saved with the following file name format: + LSN.RELTABLESPACE.DATOID.RELNODE.BLKNOFORK + + The file names are composed of the following parts: + + + + + Component + Description + + + + + + LSN + The LSN of the record with this image, + formatted as two 8-character hexadecimal numbers + %08X-%08X + + + + RELTABLESPACE + tablespace OID of the block + + + + DATOID + database OID of the block + + + + RELNODE + filenode of the block + + + + BLKNO + block number of the block + + + + FORK + + The name of the fork the full page image came from, as of + _main, _fsm, + _vm, or _init. + + + + + + + + + -- cgit v1.2.3