バージョンごとのドキュメント一覧

pg_waldump

pg_waldump <refpurpose>display a human-readable rendering of the write-ahead log of a <productname>PostgreSQL</productname> database cluster</refpurpose> PostgreSQLデータベースクラスタの先行書き込みログを可読性が高い表現で表示する

概要

pg_waldump [option...] [startseg [endseg]]

説明

<title>Description</title>

<command>pg_waldump</command> displays the write-ahead log (WAL) and is mainly useful for debugging or educational purposes. pg_waldumpは先行書き出しログ(WAL)を表示します。 主にデバッグや学習目的に有用です。

This utility can only be run by the user who installed the server, because it requires read-only access to the data directory. データディレクトリへの読み取り専用のアクセスが必要ですので、このユーティリティはサーバをインストールしたユーザによってのみ実行することができます。

オプション

<title>Options</title>

The following command-line options control the location and format of the output: 以下のコマンドラインオプションは場所や出力書式を制御します。

startseg

Start reading at the specified WAL segment file. This implicitly determines the path in which files will be searched for, and the timeline to use. 指定したWALセグメントファイルから読み取りを開始します。 これは暗黙的に検索されるファイルのパスや使用するタイムラインを決定します。

endseg

Stop after reading the specified WAL segment file. 指定したWALセグメントファイルを読み取り後終了します。

-b
--bkp-details

Output detailed information about backup blocks. バックアップブロックに関する詳細情報を出力します。

-B block
--block=block

Only display records that modify the given block. The relation must also be provided with <option>&#45;-relation</option> or <option>-R</option>. 指定されたブロックを修正するレコードのみを表示します。 リレーションも、--relationまたは-Rで指定しなければなりません。

-e end
--end=end

Stop reading at the specified WAL location, instead of reading to the end of the log stream. ログストリームの終了点まで読み取る代わりに、指定したWAL位置で読み取りを終了します。

-f
--follow

After reaching the end of valid WAL, keep polling once per second for new WAL to appear. 有効なWALの終わりに到達した後、新しいWALが現れるのを1秒間に1回ポーリングし続けます。

-F fork
--fork=fork

If provided, only display records that modify blocks in the given fork. The valid values are <literal>main</literal> for the main fork, <literal>fsm</literal> for the free space map, <literal>vm</literal> for the visibility map, and <literal>init</literal> for the init fork. 指定されると、指定されたフォーク内のブロックを変更するレコードのみを表示します。 有効な値は、メインフォークのmain、空き領域マップのfsm、可視性マップのvm、initフォークのinitです。

-n limit
--limit=limit

Display the specified number of records, then stop. 指定レコード数を表示し、終了します。

-p path
--path=path

Specifies a directory to search for WAL segment files or a directory with a <literal>pg_wal</literal> subdirectory that contains such files. The default is to search in the current directory, the <literal>pg_wal</literal> subdirectory of the current directory, and the <literal>pg_wal</literal> subdirectory of <envar>PGDATA</envar>. WALセグメントファイルを見つけ出すディレクトリ、あるいはWALセグメントファイルが含まれるpg_walサブディレクトリが含まれるディレクトリを指定します。 デフォルトではカレントディレクトリ、カレントディレクトリ内のpg_walサブディレクトリ、PGDATApg_walサブディレクトリから検索されます。

-q
--quiet

Do not print any output, except for errors. This option can be useful when you want to know whether a range of WAL records can be successfully parsed but don't care about the record contents. エラーを除いて、出力を表示しません。 このオプションは、WALレコードの範囲の解析に成功したかを知りたいがレコードの内容を気にしない場合には有用でしょう。

-r rmgr
--rmgr=rmgr

Only display records generated by the specified resource manager. You can specify the option multiple times to select multiple resource managers. If <literal>list</literal> is passed as name, print a list of valid resource manager names, and exit. 指定されたリソースマネージャによって生成されたレコードのみを表示します。 リソースマネージャを複数選択するために、このオプションを複数回指定できます。 listが名称として渡された場合は、有効なリソースマネージャの一覧を表示し、終了します。

Extensions may define custom resource managers, but pg_waldump does not load the extension module and therefore does not recognize custom resource managers by name. Instead, you can specify the custom resource managers as <literal>custom###</literal> where "<literal>###</literal>" is the three-digit resource manager ID. Names of this form will always be considered valid. 拡張はカスタムリソースマネージャを定義するかもしれませんが、pg_waldumpは拡張モジュールをロードせず、したがってカスタムリソースマネージャを名前で認識しません。 その代わり、カスタムリソースマネージャをcustom###として指定できます。 ここで"###"は3桁のリソースマネージャIDです。 この形式の名前は常に有効とみなされます。

-R tblspc/db/rel
--relation=tblspc/db/rel

Only display records that modify blocks in the given relation. The relation is specified with tablespace OID, database OID, and relfilenode separated by slashes, for example <literal>1234/12345/12345</literal>. This is the same format used for relations in the program's output. 指定されたリレーションのブロックを変更するレコードのみを表示します。 リレーションは、1234/12345/12345のように、スラッシュで区切られたテーブル空間OID、データベースOIDおよびrelfilenodeで指定されます。 これは、プログラムの出力でリレーションに使われる形式と同じです。

-s start
--start=start

WAL location at which to start reading. The default is to start reading the first valid WAL record found in the earliest file found. 読み取りを始めるWAL位置です。 デフォルトでは、最初に見つかったファイルの中で最初に見つかったWALレコードから読み取りを始めます。

-t timeline
--timeline=timeline

Timeline from which to read WAL records. The default is to use the value in <replaceable>startseg</replaceable>, if that is specified; otherwise, the default is 1. The value can be specified in decimal or hexadecimal, for example <literal>17</literal> or <literal>0x11</literal>. WALレコードの読み取り先のタイムラインです。 デフォルトでは、startsegが指定されている場合はstartseg内の値が使用されます。 指定がない場合のデフォルトは1です。 値は10進数または16進数で指定できます。例えば170x11です。

-V
--version

Print the <application>pg_waldump</application> version and exit. pg_waldumpのバージョンを表示し終了します。

-w
--fullpage

Only display records that include full page images. ページ全体のイメージを含むレコードのみを表示します。

-x xid
--xid=xid

Only display records marked with the given transaction ID. 指定されたトランザクションIDで印付けられたレコードのみを表示します。

-z
--stats[=record]

Display summary statistics (number and size of records and full-page images) instead of individual records. Optionally generate statistics per-record instead of per-rmgr. 個々のレコードの代わりに要約統計(レコードおよびページ全体のイメージの数とサイズ)を表示します。 オプションでrmgr毎の代わりにレコード毎の統計を生成します。

If <application>pg_waldump</application> is terminated by signal <systemitem>SIGINT</systemitem> (<keycombo action="simul"><keycap>Control</keycap><keycap>C</keycap></keycombo>), the summary of the statistics computed is displayed up to the termination point. This operation is not supported on <productname>Windows</productname>. pg_waldumpがシグナルSIGINT(Control+C)で終了した場合、計算された統計情報の要約が終了点まで表示されます。 この操作はWindowsではサポートされていません。

--save-fullpage=save_path

Save full page images found in the WAL records to the <replaceable>save_path</replaceable> directory. The images saved are subject to the same filtering and limiting criteria as the records displayed. WALレコードで見つかったページ全体のイメージをsave_pathディレクトリに保存します。 保存されたイメージは、表示されたレコードと同じフィルタおよび制限条件に従います。

The full page images are saved with the following file name format: <literal><replaceable>TIMELINE</replaceable>-<replaceable>LSN</replaceable>.<replaceable>RELTABLESPACE</replaceable>.<replaceable>DATOID</replaceable>.<replaceable>RELNODE</replaceable>.<replaceable>BLKNO</replaceable><replaceable>FORK</replaceable></literal> ページ全体のイメージは、次のファイル名形式で保存されます。 TIMELINE-LSN.RELTABLESPACE.DATOID.RELNODE.BLKNOFORK The file names are composed of the following parts: ファイル名は、次の部分で構成されます。

構成要素説明
TIMELINE 8文字の16進数1つ%08Xで表された、そのレコードがあるWALセグメントファイルのタイムライン
LSN 8文字の16進数2つ%08X-%08Xで表された、このイメージのレコードのLSN
RELTABLESPACEブロックのテーブル空間OID
DATOIDブロックのデータベースOID
RELNODEブロックのファイルノード
BLKNOブロックのブロック番号
FORK The name of the fork the full page image came from, such as <literal>_main</literal>, <literal>_fsm</literal>, <literal>_vm</literal>, or <literal>_init</literal>. _main_fsm_vm_initのような、ページ全体のイメージの由来するフォークの名前

-?
--help

Show help about <application>pg_waldump</application> command line arguments, and exit. pg_waldumpのコマンドライン引数に関する説明を表示し、終了します。

環境

<title>Environment</title>
PGDATA

Data directory; see also the <option>-p</option> option. データディレクトリ。-pオプションも参照してください。

PG_COLOR

Specifies whether to use color in diagnostic messages. Possible values are <literal>always</literal>, <literal>auto</literal> and <literal>never</literal>. 診断メッセージで色を使うかどうかを指定します。 可能な値はalwaysautoneverです。

注釈

<title>Notes</title>

Can give wrong results when the server is running. サーバが実行中の場合は間違った結果になることがあります。

Only the specified timeline is displayed (or the default, if none is specified). Records in other timelines are ignored. 指定されたタイムラインのみが表示されます(指定がなければデフォルトのみが表示)。 他のタイムラインのレコードは無視されます。

<application>pg_waldump</application> cannot read WAL files with suffix <literal>.partial</literal>. If those files need to be read, <literal>.partial</literal> suffix needs to be removed from the file name. pg_waldumpは拡張子.partialのWALファイルを読むことはできません。 読む必要がある場合は、ファイル名から拡張子.partialを削除してください。

関連項目

<title>See Also</title> 30.6