<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >pg_xlogdump</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REV="MADE" HREF="mailto:pgsql-docs@postgresql.org"><LINK REL="HOME" TITLE="PostgreSQL 9.4.12 Documentation" HREF="index.html"><LINK REL="UP" TITLE="Server Applications" HREF="contrib-prog-server.html"><LINK REL="PREVIOUS" TITLE="pg_upgrade" HREF="pgupgrade.html"><LINK REL="NEXT" TITLE="External Projects" HREF="external-projects.html"><LINK REL="STYLESHEET" TYPE="text/css" HREF="stylesheet.css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><META NAME="creation" CONTENT="2017-07-13T18:41:18"></HEAD ><BODY CLASS="REFENTRY" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="4" ALIGN="center" VALIGN="bottom" ><A HREF="index.html" >PostgreSQL 9.4.12 Documentation</A ></TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A TITLE="pg_upgrade" HREF="pgupgrade.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A HREF="contrib-prog-server.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="60%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="20%" ALIGN="right" VALIGN="top" ><A TITLE="External Projects" HREF="external-projects.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="PGXLOGDUMP" ></A ><SPAN CLASS="APPLICATION" >pg_xlogdump</SPAN ></H1 ><DIV CLASS="REFNAMEDIV" ><A NAME="AEN171150" ></A ><H2 >Name</H2 >pg_xlogdump -- display a human-readable rendering of the write-ahead log of a <SPAN CLASS="PRODUCTNAME" >PostgreSQL</SPAN > database cluster</DIV ><DIV CLASS="REFSYNOPSISDIV" ><A NAME="AEN171154" ></A ><H2 >Synopsis</H2 ><P ><TT CLASS="COMMAND" >pg_xlogdump</TT > [<TT CLASS="OPTION" >option</TT >...] [<TT CLASS="OPTION" >startseg</TT > [<TT CLASS="OPTION" >endseg</TT >] ]</P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="R1-APP-PGXLOGDUMP-1" ></A ><H2 >Description</H2 ><P > <TT CLASS="COMMAND" >pg_xlogdump</TT > displays the write-ahead log (WAL) and is mainly useful for debugging or educational purposes. </P ><P > This utility can only be run by the user who installed the server, because it requires read-only access to the data directory. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN171168" ></A ><H2 >Options</H2 ><P > The following command-line options control the location and format of the output: <P ></P ></P><DIV CLASS="VARIABLELIST" ><DL ><DT ><TT CLASS="REPLACEABLE" ><I >startseg</I ></TT ></DT ><DD ><P > Start reading at the specified log segment file. This implicitly determines the path in which files will be searched for, and the timeline to use. </P ></DD ><DT ><TT CLASS="REPLACEABLE" ><I >endseg</I ></TT ></DT ><DD ><P > Stop after reading the specified log segment file. </P ></DD ><DT ><TT CLASS="OPTION" >-b</TT ><BR><TT CLASS="OPTION" >--bkp-details</TT ></DT ><DD ><P > Output detailed information about backup blocks. </P ></DD ><DT ><TT CLASS="OPTION" >-e <TT CLASS="REPLACEABLE" ><I >end</I ></TT ></TT ><BR><TT CLASS="OPTION" >--end=<TT CLASS="REPLACEABLE" ><I >end</I ></TT ></TT ></DT ><DD ><P > Stop reading at the specified log position, instead of reading to the end of the log stream. </P ></DD ><DT ><TT CLASS="OPTION" >-f</TT ><BR><TT CLASS="OPTION" >--follow</TT ></DT ><DD ><P > After reaching the end of valid WAL, keep polling once per second for new WAL to appear. </P ></DD ><DT ><TT CLASS="OPTION" >-n <TT CLASS="REPLACEABLE" ><I >limit</I ></TT ></TT ><BR><TT CLASS="OPTION" >--limit=<TT CLASS="REPLACEABLE" ><I >limit</I ></TT ></TT ></DT ><DD ><P > Display the specified number of records, then stop. </P ></DD ><DT ><TT CLASS="OPTION" >-p <TT CLASS="REPLACEABLE" ><I >path</I ></TT ></TT ><BR><TT CLASS="OPTION" >--path=<TT CLASS="REPLACEABLE" ><I >path</I ></TT ></TT ></DT ><DD ><P > Directory in which to find log segment files. The default is to search for them in the <TT CLASS="LITERAL" >pg_xlog</TT > subdirectory of the current directory. </P ></DD ><DT ><TT CLASS="OPTION" >-r <TT CLASS="REPLACEABLE" ><I >rmgr</I ></TT ></TT ><BR><TT CLASS="OPTION" >--rmgr=<TT CLASS="REPLACEABLE" ><I >rmgr</I ></TT ></TT ></DT ><DD ><P > Only display records generated by the specified resource manager. If <TT CLASS="LITERAL" >list</TT > is passed as name, print a list of valid resource manager names, and exit. </P ></DD ><DT ><TT CLASS="OPTION" >-s <TT CLASS="REPLACEABLE" ><I >start</I ></TT ></TT ><BR><TT CLASS="OPTION" >--start=<TT CLASS="REPLACEABLE" ><I >start</I ></TT ></TT ></DT ><DD ><P > Log position at which to start reading. The default is to start reading the first valid log record found in the earliest file found. </P ></DD ><DT ><TT CLASS="OPTION" >-t <TT CLASS="REPLACEABLE" ><I >timeline</I ></TT ></TT ><BR><TT CLASS="OPTION" >--timeline=<TT CLASS="REPLACEABLE" ><I >timeline</I ></TT ></TT ></DT ><DD ><P > Timeline from which to read log records. The default is to use the value in <TT CLASS="LITERAL" >startseg</TT >, if that is specified; otherwise, the default is 1. </P ></DD ><DT ><TT CLASS="OPTION" >-V</TT ><BR><TT CLASS="OPTION" >--version</TT ></DT ><DD ><P > Print the <SPAN CLASS="APPLICATION" >pg_xlogdump</SPAN > version and exit. </P ></DD ><DT ><TT CLASS="OPTION" >-x <TT CLASS="REPLACEABLE" ><I >xid</I ></TT ></TT ><BR><TT CLASS="OPTION" >--xid=<TT CLASS="REPLACEABLE" ><I >xid</I ></TT ></TT ></DT ><DD ><P > Only display records marked with the given TransactionId. </P ></DD ><DT ><TT CLASS="OPTION" >-?</TT ><BR><TT CLASS="OPTION" >--help</TT ></DT ><DD ><P > Show help about <SPAN CLASS="APPLICATION" >pg_xlogdump</SPAN > command line arguments, and exit. </P ></DD ></DL ></DIV ><P> </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN171278" ></A ><H2 >Notes</H2 ><P > Can give wrong results when the server is running. </P ><P > Only the specified timeline is displayed (or the default, if none is specified). Records in other timelines are ignored. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN171282" ></A ><H2 >See Also</H2 ><A HREF="wal-internals.html" >Section 29.5</A ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="pgupgrade.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="external-projects.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><SPAN CLASS="APPLICATION" >pg_upgrade</SPAN ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="contrib-prog-server.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >External Projects</TD ></TR ></TABLE ></DIV ></BODY ></HTML >