mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Rename user-facing tools with "xlog" in the name to say "wal".
This means pg_receivexlog because pg_receivewal, pg_resetxlog becomes pg_resetwal, and pg_xlogdump becomes pg_waldump.
This commit is contained in:
@ -1321,7 +1321,7 @@ the connection to be used for logical replication from that database.
|
|||||||
psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
|
psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
|
||||||
</programlisting>
|
</programlisting>
|
||||||
However, it is often more useful to use
|
However, it is often more useful to use
|
||||||
<xref linkend="app-pgreceivexlog"> (for physical replication) or
|
<xref linkend="app-pgreceivewal"> (for physical replication) or
|
||||||
<xref linkend="app-pgrecvlogical"> (for logical replication).
|
<xref linkend="app-pgrecvlogical"> (for logical replication).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -198,15 +198,15 @@ Complete list of usable sgml source files in this directory.
|
|||||||
<!ENTITY pgDump SYSTEM "pg_dump.sgml">
|
<!ENTITY pgDump SYSTEM "pg_dump.sgml">
|
||||||
<!ENTITY pgDumpall SYSTEM "pg_dumpall.sgml">
|
<!ENTITY pgDumpall SYSTEM "pg_dumpall.sgml">
|
||||||
<!ENTITY pgIsready SYSTEM "pg_isready.sgml">
|
<!ENTITY pgIsready SYSTEM "pg_isready.sgml">
|
||||||
<!ENTITY pgReceivexlog SYSTEM "pg_receivexlog.sgml">
|
<!ENTITY pgReceivewal SYSTEM "pg_receivewal.sgml">
|
||||||
<!ENTITY pgRecvlogical SYSTEM "pg_recvlogical.sgml">
|
<!ENTITY pgRecvlogical SYSTEM "pg_recvlogical.sgml">
|
||||||
<!ENTITY pgResetxlog SYSTEM "pg_resetxlog.sgml">
|
<!ENTITY pgResetwal SYSTEM "pg_resetwal.sgml">
|
||||||
<!ENTITY pgRestore SYSTEM "pg_restore.sgml">
|
<!ENTITY pgRestore SYSTEM "pg_restore.sgml">
|
||||||
<!ENTITY pgRewind SYSTEM "pg_rewind.sgml">
|
<!ENTITY pgRewind SYSTEM "pg_rewind.sgml">
|
||||||
<!ENTITY pgtestfsync SYSTEM "pgtestfsync.sgml">
|
<!ENTITY pgtestfsync SYSTEM "pgtestfsync.sgml">
|
||||||
<!ENTITY pgtesttiming SYSTEM "pgtesttiming.sgml">
|
<!ENTITY pgtesttiming SYSTEM "pgtesttiming.sgml">
|
||||||
<!ENTITY pgupgrade SYSTEM "pgupgrade.sgml">
|
<!ENTITY pgupgrade SYSTEM "pgupgrade.sgml">
|
||||||
<!ENTITY pgxlogdump SYSTEM "pg_xlogdump.sgml">
|
<!ENTITY pgwaldump SYSTEM "pg_waldump.sgml">
|
||||||
<!ENTITY postgres SYSTEM "postgres-ref.sgml">
|
<!ENTITY postgres SYSTEM "postgres-ref.sgml">
|
||||||
<!ENTITY postmaster SYSTEM "postmaster.sgml">
|
<!ENTITY postmaster SYSTEM "postmaster.sgml">
|
||||||
<!ENTITY psqlRef SYSTEM "psql-ref.sgml">
|
<!ENTITY psqlRef SYSTEM "psql-ref.sgml">
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
<!--
|
<!--
|
||||||
doc/src/sgml/ref/pg_receivexlog.sgml
|
doc/src/sgml/ref/pg_receivewal.sgml
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<refentry id="app-pgreceivexlog">
|
<refentry id="app-pgreceivewal">
|
||||||
<indexterm zone="app-pgreceivexlog">
|
<indexterm zone="app-pgreceivewal">
|
||||||
<primary>pg_receivexlog</primary>
|
<primary>pg_receivewal</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle>pg_receivexlog</refentrytitle>
|
<refentrytitle>pg_receivewal</refentrytitle>
|
||||||
<manvolnum>1</manvolnum>
|
<manvolnum>1</manvolnum>
|
||||||
<refmiscinfo>Application</refmiscinfo>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>pg_receivexlog</refname>
|
<refname>pg_receivewal</refname>
|
||||||
<refpurpose>stream transaction logs from a <productname>PostgreSQL</productname> server</refpurpose>
|
<refpurpose>stream transaction logs from a <productname>PostgreSQL</productname> server</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>pg_receivexlog</command>
|
<command>pg_receivewal</command>
|
||||||
<arg rep="repeat"><replaceable>option</></arg>
|
<arg rep="repeat"><replaceable>option</></arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
@ -31,7 +31,7 @@ PostgreSQL documentation
|
|||||||
Description
|
Description
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<application>pg_receivexlog</application> is used to stream the transaction log
|
<application>pg_receivewal</application> is used to stream the transaction log
|
||||||
from a running <productname>PostgreSQL</productname> cluster. The transaction
|
from a running <productname>PostgreSQL</productname> cluster. The transaction
|
||||||
log is streamed using the streaming replication protocol, and is written
|
log is streamed using the streaming replication protocol, and is written
|
||||||
to a local directory of files. This directory can be used as the archive
|
to a local directory of files. This directory can be used as the archive
|
||||||
@ -40,16 +40,16 @@ PostgreSQL documentation
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>pg_receivexlog</application> streams the transaction
|
<application>pg_receivewal</application> streams the transaction
|
||||||
log in real time as it's being generated on the server, and does not wait
|
log in real time as it's being generated on the server, and does not wait
|
||||||
for segments to complete like <xref linkend="guc-archive-command"> does.
|
for segments to complete like <xref linkend="guc-archive-command"> does.
|
||||||
For this reason, it is not necessary to set
|
For this reason, it is not necessary to set
|
||||||
<xref linkend="guc-archive-timeout"> when using
|
<xref linkend="guc-archive-timeout"> when using
|
||||||
<application>pg_receivexlog</application>.
|
<application>pg_receivewal</application>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Unlike the WAL receiver of a PostgreSQL standby server, <application>pg_receivexlog</>
|
Unlike the WAL receiver of a PostgreSQL standby server, <application>pg_receivewal</>
|
||||||
by default flushes WAL data only when a WAL file is closed.
|
by default flushes WAL data only when a WAL file is closed.
|
||||||
The option <option>--synchronous</> must be specified to flush WAL data
|
The option <option>--synchronous</> must be specified to flush WAL data
|
||||||
in real time.
|
in real time.
|
||||||
@ -68,7 +68,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
If the connection is lost, or if it cannot be initially established,
|
If the connection is lost, or if it cannot be initially established,
|
||||||
with a non-fatal error, <application>pg_receivexlog</application> will
|
with a non-fatal error, <application>pg_receivewal</application> will
|
||||||
retry the connection indefinitely, and reestablish streaming as soon
|
retry the connection indefinitely, and reestablish streaming as soon
|
||||||
as possible. To avoid this behavior, use the <literal>-n</literal>
|
as possible. To avoid this behavior, use the <literal>-n</literal>
|
||||||
parameter.
|
parameter.
|
||||||
@ -132,9 +132,9 @@ PostgreSQL documentation
|
|||||||
<term><option>--slot=<replaceable class="parameter">slotname</replaceable></option></term>
|
<term><option>--slot=<replaceable class="parameter">slotname</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Require <application>pg_receivexlog</application> to use an existing
|
Require <application>pg_receivewal</application> to use an existing
|
||||||
replication slot (see <xref linkend="streaming-replication-slots">).
|
replication slot (see <xref linkend="streaming-replication-slots">).
|
||||||
When this option is used, <application>pg_receivexlog</> will report
|
When this option is used, <application>pg_receivewal</> will report
|
||||||
a flush position to the server, indicating when each segment has been
|
a flush position to the server, indicating when each segment has been
|
||||||
synchronized to disk so that the server can remove that segment if it
|
synchronized to disk so that the server can remove that segment if it
|
||||||
is not otherwise needed.
|
is not otherwise needed.
|
||||||
@ -142,7 +142,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
When the replication client
|
When the replication client
|
||||||
of <application>pg_receivexlog</application> is configured on the
|
of <application>pg_receivewal</application> is configured on the
|
||||||
server as a synchronous standby, then using a replication slot will
|
server as a synchronous standby, then using a replication slot will
|
||||||
report the flush position to the server, but only when a WAL file is
|
report the flush position to the server, but only when a WAL file is
|
||||||
closed. Therefore, that configuration will cause transactions on the
|
closed. Therefore, that configuration will cause transactions on the
|
||||||
@ -164,7 +164,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option should be specified if the replication client
|
This option should be specified if the replication client
|
||||||
of <application>pg_receivexlog</application> is configured on the
|
of <application>pg_receivewal</application> is configured on the
|
||||||
server as a synchronous standby, to ensure that timely feedback is
|
server as a synchronous standby, to ensure that timely feedback is
|
||||||
sent to the server.
|
sent to the server.
|
||||||
</para>
|
</para>
|
||||||
@ -209,7 +209,7 @@ PostgreSQL documentation
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The option is called <literal>--dbname</> for consistency with other
|
The option is called <literal>--dbname</> for consistency with other
|
||||||
client applications, but because <application>pg_receivexlog</application>
|
client applications, but because <application>pg_receivewal</application>
|
||||||
doesn't connect to any particular database in the cluster, database
|
doesn't connect to any particular database in the cluster, database
|
||||||
name in the connection string will be ignored.
|
name in the connection string will be ignored.
|
||||||
</para>
|
</para>
|
||||||
@ -273,15 +273,15 @@ PostgreSQL documentation
|
|||||||
<term><option>--password</option></term>
|
<term><option>--password</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Force <application>pg_receivexlog</application> to prompt for a
|
Force <application>pg_receivewal</application> to prompt for a
|
||||||
password before connecting to a database.
|
password before connecting to a database.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option is never essential, since
|
This option is never essential, since
|
||||||
<application>pg_receivexlog</application> will automatically prompt
|
<application>pg_receivewal</application> will automatically prompt
|
||||||
for a password if the server demands password authentication.
|
for a password if the server demands password authentication.
|
||||||
However, <application>pg_receivexlog</application> will waste a
|
However, <application>pg_receivewal</application> will waste a
|
||||||
connection attempt finding out that the server wants a password.
|
connection attempt finding out that the server wants a password.
|
||||||
In some cases it is worth typing <option>-W</> to avoid the extra
|
In some cases it is worth typing <option>-W</> to avoid the extra
|
||||||
connection attempt.
|
connection attempt.
|
||||||
@ -292,7 +292,7 @@ PostgreSQL documentation
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>pg_receivexlog</application> can perform one of the two
|
<application>pg_receivewal</application> can perform one of the two
|
||||||
following actions in order to control physical replication slots:
|
following actions in order to control physical replication slots:
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
@ -327,7 +327,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--version</></term>
|
<term><option>--version</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print the <application>pg_receivexlog</application> version and exit.
|
Print the <application>pg_receivewal</application> version and exit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -337,7 +337,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--help</></term>
|
<term><option>--help</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Show help about <application>pg_receivexlog</application> command line
|
Show help about <application>pg_receivewal</application> command line
|
||||||
arguments, and exit.
|
arguments, and exit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -363,7 +363,7 @@ PostgreSQL documentation
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
When using <application>pg_receivexlog</application> instead of
|
When using <application>pg_receivewal</application> instead of
|
||||||
<xref linkend="guc-archive-command"> as the main WAL backup method, it is
|
<xref linkend="guc-archive-command"> as the main WAL backup method, it is
|
||||||
strongly recommended to use replication slots. Otherwise, the server is
|
strongly recommended to use replication slots. Otherwise, the server is
|
||||||
free to recycle or remove transaction log files before they are backed up,
|
free to recycle or remove transaction log files before they are backed up,
|
||||||
@ -384,7 +384,7 @@ PostgreSQL documentation
|
|||||||
<literal>mydbserver</literal> and store it in the local directory
|
<literal>mydbserver</literal> and store it in the local directory
|
||||||
<filename>/usr/local/pgsql/archive</filename>:
|
<filename>/usr/local/pgsql/archive</filename>:
|
||||||
<screen>
|
<screen>
|
||||||
<prompt>$</prompt> <userinput>pg_receivexlog -h mydbserver -D /usr/local/pgsql/archive</userinput>
|
<prompt>$</prompt> <userinput>pg_receivewal -h mydbserver -D /usr/local/pgsql/archive</userinput>
|
||||||
</screen></para>
|
</screen></para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
@ -35,7 +35,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
It creates a replication-mode connection, so it is subject to the same
|
It creates a replication-mode connection, so it is subject to the same
|
||||||
constraints as <xref linkend="app-pgreceivexlog">, plus those for logical
|
constraints as <xref linkend="app-pgreceivewal">, plus those for logical
|
||||||
replication (see <xref linkend="logicaldecoding">).
|
replication (see <xref linkend="logicaldecoding">).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option has the same effect as the option of the same name
|
This option has the same effect as the option of the same name
|
||||||
in <xref linkend="app-pgreceivexlog">. See the description there.
|
in <xref linkend="app-pgreceivewal">. See the description there.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -411,7 +411,7 @@ PostgreSQL documentation
|
|||||||
<title>See Also</title>
|
<title>See Also</title>
|
||||||
|
|
||||||
<simplelist type="inline">
|
<simplelist type="inline">
|
||||||
<member><xref linkend="app-pgreceivexlog"></member>
|
<member><xref linkend="app-pgreceivewal"></member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
<!--
|
<!--
|
||||||
doc/src/sgml/ref/pg_resetxlog.sgml
|
doc/src/sgml/ref/pg_resetwal.sgml
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<refentry id="APP-PGRESETXLOG">
|
<refentry id="APP-PGRESETWAL">
|
||||||
<indexterm zone="app-pgresetxlog">
|
<indexterm zone="app-pgresetwal">
|
||||||
<primary>pg_resetxlog</primary>
|
<primary>pg_resetwal</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle><application>pg_resetxlog</application></refentrytitle>
|
<refentrytitle><application>pg_resetwal</application></refentrytitle>
|
||||||
<manvolnum>1</manvolnum>
|
<manvolnum>1</manvolnum>
|
||||||
<refmiscinfo>Application</refmiscinfo>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>pg_resetxlog</refname>
|
<refname>pg_resetwal</refname>
|
||||||
<refpurpose>reset the write-ahead log and other control information of a <productname>PostgreSQL</productname> database cluster</refpurpose>
|
<refpurpose>reset the write-ahead log and other control information of a <productname>PostgreSQL</productname> database cluster</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>pg_resetxlog</command>
|
<command>pg_resetwal</command>
|
||||||
<arg choice="opt"><option>-f</option></arg>
|
<arg choice="opt"><option>-f</option></arg>
|
||||||
<arg choice="opt"><option>-n</option></arg>
|
<arg choice="opt"><option>-n</option></arg>
|
||||||
<arg rep="repeat"><replaceable>option</replaceable></arg>
|
<arg rep="repeat"><replaceable>option</replaceable></arg>
|
||||||
@ -29,10 +29,10 @@ PostgreSQL documentation
|
|||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1 id="R1-APP-PGRESETXLOG-1">
|
<refsect1 id="R1-APP-PGRESETWAL-1">
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
<para>
|
<para>
|
||||||
<command>pg_resetxlog</command> clears the write-ahead log (WAL) and
|
<command>pg_resetwal</command> clears the write-ahead log (WAL) and
|
||||||
optionally resets some other control information stored in the
|
optionally resets some other control information stored in the
|
||||||
<filename>pg_control</> file. This function is sometimes needed
|
<filename>pg_control</> file. This function is sometimes needed
|
||||||
if these files have become corrupted. It should be used only as a
|
if these files have become corrupted. It should be used only as a
|
||||||
@ -51,12 +51,12 @@ PostgreSQL documentation
|
|||||||
This utility can only be run by the user who installed the server, because
|
This utility can only be run by the user who installed the server, because
|
||||||
it requires read/write access to the data directory.
|
it requires read/write access to the data directory.
|
||||||
For safety reasons, you must specify the data directory on the command line.
|
For safety reasons, you must specify the data directory on the command line.
|
||||||
<command>pg_resetxlog</command> does not use the environment variable
|
<command>pg_resetwal</command> does not use the environment variable
|
||||||
<envar>PGDATA</>.
|
<envar>PGDATA</>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If <command>pg_resetxlog</command> complains that it cannot determine
|
If <command>pg_resetwal</command> complains that it cannot determine
|
||||||
valid data for <filename>pg_control</>, you can force it to proceed anyway
|
valid data for <filename>pg_control</>, you can force it to proceed anyway
|
||||||
by specifying the <option>-f</> (force) option. In this case plausible
|
by specifying the <option>-f</> (force) option. In this case plausible
|
||||||
values will be substituted for the missing data. Most of the fields can be
|
values will be substituted for the missing data. Most of the fields can be
|
||||||
@ -80,7 +80,7 @@ PostgreSQL documentation
|
|||||||
<term><option>-f</option></term>
|
<term><option>-f</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Force <command>pg_resetxlog</command> to proceed even if it cannot determine
|
Force <command>pg_resetwal</command> to proceed even if it cannot determine
|
||||||
valid data for <filename>pg_control</>, as explained above.
|
valid data for <filename>pg_control</>, as explained above.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -91,10 +91,10 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <option>-n</> (no operation) option instructs
|
The <option>-n</> (no operation) option instructs
|
||||||
<command>pg_resetxlog</command> to print the values reconstructed from
|
<command>pg_resetwal</command> to print the values reconstructed from
|
||||||
<filename>pg_control</> and values about to be changed, and then exit
|
<filename>pg_control</> and values about to be changed, and then exit
|
||||||
without modifying anything. This is mainly a debugging tool, but can be
|
without modifying anything. This is mainly a debugging tool, but can be
|
||||||
useful as a sanity check before allowing <command>pg_resetxlog</command>
|
useful as a sanity check before allowing <command>pg_resetwal</command>
|
||||||
to proceed for real.
|
to proceed for real.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -115,7 +115,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The following options are only needed when
|
The following options are only needed when
|
||||||
<command>pg_resetxlog</command> is unable to determine appropriate values
|
<command>pg_resetwal</command> is unable to determine appropriate values
|
||||||
by reading <filename>pg_control</>. Safe values can be determined as
|
by reading <filename>pg_control</>. Safe values can be determined as
|
||||||
described below. For values that take numeric arguments, hexadecimal
|
described below. For values that take numeric arguments, hexadecimal
|
||||||
values can be specified by using the prefix <literal>0x</literal>.
|
values can be specified by using the prefix <literal>0x</literal>.
|
||||||
@ -152,7 +152,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The transaction ID epoch is not actually stored anywhere in the database
|
The transaction ID epoch is not actually stored anywhere in the database
|
||||||
except in the field that is set by <command>pg_resetxlog</command>,
|
except in the field that is set by <command>pg_resetwal</command>,
|
||||||
so any value will work so far as the database itself is concerned.
|
so any value will work so far as the database itself is concerned.
|
||||||
You might need to adjust this value to ensure that replication
|
You might need to adjust this value to ensure that replication
|
||||||
systems such as <application>Slony-I</> and
|
systems such as <application>Slony-I</> and
|
||||||
@ -164,7 +164,7 @@ PostgreSQL documentation
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-l</option> <replaceable class="parameter">xlogfile</replaceable></term>
|
<term><option>-l</option> <replaceable class="parameter">walfile</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Manually set the WAL starting address.
|
Manually set the WAL starting address.
|
||||||
@ -182,7 +182,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
<command>pg_resetxlog</command> itself looks at the files in
|
<command>pg_resetwal</command> itself looks at the files in
|
||||||
<filename>pg_wal</> and chooses a default <option>-l</> setting
|
<filename>pg_wal</> and chooses a default <option>-l</> setting
|
||||||
beyond the last existing file name. Therefore, manual adjustment of
|
beyond the last existing file name. Therefore, manual adjustment of
|
||||||
<option>-l</> should only be needed if you are aware of WAL segment
|
<option>-l</> should only be needed if you are aware of WAL segment
|
||||||
@ -274,11 +274,11 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
This command must not be used when the server is
|
This command must not be used when the server is
|
||||||
running. <command>pg_resetxlog</command> will refuse to start up if
|
running. <command>pg_resetwal</command> will refuse to start up if
|
||||||
it finds a server lock file in the data directory. If the
|
it finds a server lock file in the data directory. If the
|
||||||
server crashed then a lock file might have been left
|
server crashed then a lock file might have been left
|
||||||
behind; in that case you can remove the lock file to allow
|
behind; in that case you can remove the lock file to allow
|
||||||
<command>pg_resetxlog</command> to run. But before you do
|
<command>pg_resetwal</command> to run. But before you do
|
||||||
so, make doubly certain that there is no server process still alive.
|
so, make doubly certain that there is no server process still alive.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
@ -1,27 +1,27 @@
|
|||||||
<!--
|
<!--
|
||||||
doc/src/sgml/ref/pg_xlogdump.sgml
|
doc/src/sgml/ref/pg_waldump.sgml
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<refentry id="pgxlogdump">
|
<refentry id="pgwaldump">
|
||||||
<indexterm zone="pgxlogdump">
|
<indexterm zone="pgwaldump">
|
||||||
<primary>pg_xlogdump</primary>
|
<primary>pg_waldump</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle><application>pg_xlogdump</application></refentrytitle>
|
<refentrytitle><application>pg_waldump</application></refentrytitle>
|
||||||
<manvolnum>1</manvolnum>
|
<manvolnum>1</manvolnum>
|
||||||
<refmiscinfo>Application</refmiscinfo>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>pg_xlogdump</refname>
|
<refname>pg_waldump</refname>
|
||||||
<refpurpose>display a human-readable rendering of the write-ahead log of a <productname>PostgreSQL</productname> database cluster</refpurpose>
|
<refpurpose>display a human-readable rendering of the write-ahead log of a <productname>PostgreSQL</productname> database cluster</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>pg_xlogdump</command>
|
<command>pg_waldump</command>
|
||||||
<arg rep="repeat" choice="opt"><option>option</option></arg>
|
<arg rep="repeat" choice="opt"><option>option</option></arg>
|
||||||
<arg choice="opt"><option>startseg</option>
|
<arg choice="opt"><option>startseg</option>
|
||||||
<arg choice="opt"><option>endseg</option></arg>
|
<arg choice="opt"><option>endseg</option></arg>
|
||||||
@ -29,10 +29,10 @@ PostgreSQL documentation
|
|||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1 id="R1-APP-PGXLOGDUMP-1">
|
<refsect1 id="R1-APP-PGWALDUMP-1">
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
<para>
|
<para>
|
||||||
<command>pg_xlogdump</command> displays the write-ahead log (WAL) and is mainly
|
<command>pg_waldump</command> displays the write-ahead log (WAL) and is mainly
|
||||||
useful for debugging or educational purposes.
|
useful for debugging or educational purposes.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--version</></term>
|
<term><option>--version</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print the <application>pg_xlogdump</application> version and exit.
|
Print the <application>pg_waldump</application> version and exit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -199,7 +199,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--help</></term>
|
<term><option>--help</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Show help about <application>pg_xlogdump</application> command line
|
Show help about <application>pg_waldump</application> command line
|
||||||
arguments, and exit.
|
arguments, and exit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -220,7 +220,7 @@ PostgreSQL documentation
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>pg_xlogdump</> cannot read WAL files with suffix
|
<application>pg_waldump</> cannot read WAL files with suffix
|
||||||
<literal>.partial</>. If those files need to be read, <literal>.partial</>
|
<literal>.partial</>. If those files need to be read, <literal>.partial</>
|
||||||
suffix needs to be removed from the file name.
|
suffix needs to be removed from the file name.
|
||||||
</para>
|
</para>
|
@ -245,7 +245,7 @@
|
|||||||
&pgDump;
|
&pgDump;
|
||||||
&pgDumpall;
|
&pgDumpall;
|
||||||
&pgIsready;
|
&pgIsready;
|
||||||
&pgReceivexlog;
|
&pgReceivewal;
|
||||||
&pgRecvlogical;
|
&pgRecvlogical;
|
||||||
&pgRestore;
|
&pgRestore;
|
||||||
&psqlRef;
|
&psqlRef;
|
||||||
@ -271,12 +271,12 @@
|
|||||||
&pgarchivecleanup;
|
&pgarchivecleanup;
|
||||||
&pgControldata;
|
&pgControldata;
|
||||||
&pgCtl;
|
&pgCtl;
|
||||||
&pgResetxlog;
|
&pgResetwal;
|
||||||
&pgRewind;
|
&pgRewind;
|
||||||
&pgtestfsync;
|
&pgtestfsync;
|
||||||
&pgtesttiming;
|
&pgtesttiming;
|
||||||
&pgupgrade;
|
&pgupgrade;
|
||||||
&pgxlogdump;
|
&pgwaldump;
|
||||||
&postgres;
|
&postgres;
|
||||||
&postmaster;
|
&postmaster;
|
||||||
|
|
||||||
|
@ -8069,7 +8069,7 @@ Branch: REL9_2_STABLE [6b700301c] 2015-02-17 16:03:00 +0100
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Add a <link
|
Add a <link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></link>
|
||||||
tool to archive WAL file changes as they are written
|
tool to archive WAL file changes as they are written
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -9231,7 +9231,7 @@ Branch: REL9_2_STABLE [6b700301c] 2015-02-17 16:03:00 +0100
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Add a <link
|
Add a <link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></link>
|
||||||
tool to archive WAL file changes as they are written, rather
|
tool to archive WAL file changes as they are written, rather
|
||||||
than waiting for completed WAL files (Magnus Hagander)
|
than waiting for completed WAL files (Magnus Hagander)
|
||||||
</para>
|
</para>
|
||||||
|
@ -10080,7 +10080,7 @@ ALTER EXTENSION hstore UPDATE;
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allow tools like <link
|
Allow tools like <link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></link>
|
||||||
to run on computers with different architectures (Heikki
|
to run on computers with different architectures (Heikki
|
||||||
Linnakangas)
|
Linnakangas)
|
||||||
</para>
|
</para>
|
||||||
@ -10110,7 +10110,7 @@ ALTER EXTENSION hstore UPDATE;
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allow <link
|
Allow <link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></link>
|
||||||
and <link
|
and <link
|
||||||
linkend="app-pgbasebackup"><application>pg_basebackup</></link>
|
linkend="app-pgbasebackup"><application>pg_basebackup</></link>
|
||||||
<option>--xlog-method</> to handle streaming timeline switches
|
<option>--xlog-method</> to handle streaming timeline switches
|
||||||
@ -10713,7 +10713,7 @@ ALTER EXTENSION hstore UPDATE;
|
|||||||
linkend="APP-PG-DUMPALL"><application>pg_dumpall</></link>, <link
|
linkend="APP-PG-DUMPALL"><application>pg_dumpall</></link>, <link
|
||||||
linkend="app-pgbasebackup"><application>pg_basebackup</></link>, and
|
linkend="app-pgbasebackup"><application>pg_basebackup</></link>, and
|
||||||
<link
|
<link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></link>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></link>
|
||||||
to allow specifying a connection string (Amit Kapila)
|
to allow specifying a connection string (Amit Kapila)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -11250,7 +11250,7 @@ ALTER EXTENSION hstore UPDATE;
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Add <link linkend="pgxlogdump"><application>pg_xlogdump</></link>
|
Add <link linkend="pgwaldump"><application>pg_xlogdump</></link>
|
||||||
contrib program (Andres Freund)
|
contrib program (Andres Freund)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -8917,8 +8917,9 @@ Branch: REL9_4_STABLE [c2b06ab17] 2015-01-30 22:45:58 -0500
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Make <xref linkend="APP-PGRESETXLOG"> with option <option>-n</>
|
Make <link linkend="app-pgresetwal"><application>pg_resetxlog</></>
|
||||||
output current and potentially changed values (Rajeev Rastogi)
|
with option <option>-n</> output current and potentially changed
|
||||||
|
values (Rajeev Rastogi)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
@ -9518,8 +9519,9 @@ Branch: REL9_4_STABLE [c2b06ab17] 2015-01-30 22:45:58 -0500
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allow <xref linkend="pgxlogdump"> to report a live log stream
|
Allow <link linkend="pgwaldump"><application>pg_xlogdump</></>
|
||||||
with <option>--follow</> (Heikki Linnakangas)
|
to report a live log stream with <option>--follow</>
|
||||||
|
(Heikki Linnakangas)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
@ -6265,7 +6265,7 @@ Add GUC and storage parameter to set the maximum size of GIN pending list.
|
|||||||
linkend="pgarchivecleanup"><application>pg_archivecleanup</></>,
|
linkend="pgarchivecleanup"><application>pg_archivecleanup</></>,
|
||||||
<link linkend="pgtestfsync"><application>pg_test_fsync</></>,
|
<link linkend="pgtestfsync"><application>pg_test_fsync</></>,
|
||||||
<link linkend="pgtesttiming"><application>pg_test_timing</></>,
|
<link linkend="pgtesttiming"><application>pg_test_timing</></>,
|
||||||
and <link linkend="pgxlogdump"><application>pg_xlogdump</></>
|
and <link linkend="pgwaldump"><application>pg_xlogdump</></>
|
||||||
from <filename>contrib</> to <filename>src/bin</> (Peter Eisentraut)
|
from <filename>contrib</> to <filename>src/bin</> (Peter Eisentraut)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -6292,7 +6292,7 @@ Add GUC and storage parameter to set the maximum size of GIN pending list.
|
|||||||
-->
|
-->
|
||||||
<para>
|
<para>
|
||||||
Allow <link
|
Allow <link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></>
|
||||||
to manage physical replication slots (Michael Paquier)
|
to manage physical replication slots (Michael Paquier)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -6308,7 +6308,7 @@ Add GUC and storage parameter to set the maximum size of GIN pending list.
|
|||||||
-->
|
-->
|
||||||
<para>
|
<para>
|
||||||
Allow <link
|
Allow <link
|
||||||
linkend="app-pgreceivexlog"><application>pg_receivexlog</></>
|
linkend="app-pgreceivewal"><application>pg_receivexlog</></>
|
||||||
to synchronously flush <acronym>WAL</> to storage using new
|
to synchronously flush <acronym>WAL</> to storage using new
|
||||||
<option>--synchronous</> option (Furuya Osamu, Fujii Masao)
|
<option>--synchronous</> option (Furuya Osamu, Fujii Masao)
|
||||||
</para>
|
</para>
|
||||||
@ -6368,7 +6368,7 @@ Add GUC and storage parameter to set the maximum size of GIN pending list.
|
|||||||
2014-09-19 [bdd5726] Andres..: Add the capability to display summary statistic..
|
2014-09-19 [bdd5726] Andres..: Add the capability to display summary statistic..
|
||||||
-->
|
-->
|
||||||
<para>
|
<para>
|
||||||
Add <link linkend="pgxlogdump"><application>pg_xlogdump</></> option
|
Add <link linkend="pgwaldump"><application>pg_xlogdump</></> option
|
||||||
<option>--stats</> to display summary statistics (Abhijit Menon-Sen)
|
<option>--stats</> to display summary statistics (Abhijit Menon-Sen)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* understand format.
|
* understand format.
|
||||||
*
|
*
|
||||||
* This routines are in xactdesc.c because they're accessed in backend (when
|
* This routines are in xactdesc.c because they're accessed in backend (when
|
||||||
* replaying WAL) and frontend (pg_xlogdump) code. This file is the only xact
|
* replaying WAL) and frontend (pg_waldump) code. This file is the only xact
|
||||||
* specific one shared between both. They're complicated enough that
|
* specific one shared between both. They're complicated enough that
|
||||||
* duplication would be bothersome.
|
* duplication would be bothersome.
|
||||||
*/
|
*/
|
||||||
|
@ -399,7 +399,7 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
|
|||||||
*
|
*
|
||||||
* We primarily check whether oldestXidDB is valid. The cases we have in
|
* We primarily check whether oldestXidDB is valid. The cases we have in
|
||||||
* mind are that that database was dropped, or the field was reset to zero
|
* mind are that that database was dropped, or the field was reset to zero
|
||||||
* by pg_resetxlog. In either case we should force recalculation of the
|
* by pg_resetwal. In either case we should force recalculation of the
|
||||||
* wrap limit. Also do it if oldestXid is old enough to be forcing
|
* wrap limit. Also do it if oldestXid is old enough to be forcing
|
||||||
* autovacuums or other actions; this ensures we update our state as soon
|
* autovacuums or other actions; this ensures we update our state as soon
|
||||||
* as possible once extra overhead is being incurred.
|
* as possible once extra overhead is being incurred.
|
||||||
|
@ -647,7 +647,7 @@ XLogTruncateRelation(RelFileNode rnode, ForkNumber forkNum,
|
|||||||
* always be one descriptor left open until the process ends, but never
|
* always be one descriptor left open until the process ends, but never
|
||||||
* more than one.
|
* more than one.
|
||||||
*
|
*
|
||||||
* XXX This is very similar to pg_xlogdump's XLogDumpXLogRead and to XLogRead
|
* XXX This is very similar to pg_waldump's XLogDumpXLogRead and to XLogRead
|
||||||
* in walsender.c but for small differences (such as lack of elog() in
|
* in walsender.c but for small differences (such as lack of elog() in
|
||||||
* frontend). Probably these should be merged at some point.
|
* frontend). Probably these should be merged at some point.
|
||||||
*/
|
*/
|
||||||
|
@ -1473,7 +1473,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)
|
|||||||
/*
|
/*
|
||||||
* We identify snapshots by the LSN they are valid for. We don't need to
|
* We identify snapshots by the LSN they are valid for. We don't need to
|
||||||
* include timelines in the name as each LSN maps to exactly one timeline
|
* include timelines in the name as each LSN maps to exactly one timeline
|
||||||
* unless the user used pg_resetxlog or similar. If a user did so, there's
|
* unless the user used pg_resetwal or similar. If a user did so, there's
|
||||||
* no hope continuing to decode anyway.
|
* no hope continuing to decode anyway.
|
||||||
*/
|
*/
|
||||||
sprintf(path, "pg_logical/snapshots/%X-%X.snap",
|
sprintf(path, "pg_logical/snapshots/%X-%X.snap",
|
||||||
|
@ -2435,7 +2435,7 @@ WalSndDone(WalSndSendDataCallback send_data)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* To figure out whether all WAL has successfully been replicated, check
|
* To figure out whether all WAL has successfully been replicated, check
|
||||||
* flush location if valid, write otherwise. Tools like pg_receivexlog
|
* flush location if valid, write otherwise. Tools like pg_receivewal
|
||||||
* will usually (unless in synchronous mode) return an invalid flush
|
* will usually (unless in synchronous mode) return an invalid flush
|
||||||
* location.
|
* location.
|
||||||
*/
|
*/
|
||||||
|
@ -2639,7 +2639,7 @@ static struct config_int ConfigureNamesInt[] =
|
|||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
&autovacuum_freeze_max_age,
|
&autovacuum_freeze_max_age,
|
||||||
/* see pg_resetxlog if you change the upper-limit value */
|
/* see pg_resetwal if you change the upper-limit value */
|
||||||
200000000, 100000, 2000000000,
|
200000000, 100000, 2000000000,
|
||||||
NULL, NULL, NULL
|
NULL, NULL, NULL
|
||||||
},
|
},
|
||||||
|
@ -21,12 +21,12 @@ SUBDIRS = \
|
|||||||
pg_controldata \
|
pg_controldata \
|
||||||
pg_ctl \
|
pg_ctl \
|
||||||
pg_dump \
|
pg_dump \
|
||||||
pg_resetxlog \
|
pg_resetwal \
|
||||||
pg_rewind \
|
pg_rewind \
|
||||||
pg_test_fsync \
|
pg_test_fsync \
|
||||||
pg_test_timing \
|
pg_test_timing \
|
||||||
pg_upgrade \
|
pg_upgrade \
|
||||||
pg_xlogdump \
|
pg_waldump \
|
||||||
pgbench \
|
pgbench \
|
||||||
psql \
|
psql \
|
||||||
scripts
|
scripts
|
||||||
|
2
src/bin/pg_basebackup/.gitignore
vendored
2
src/bin/pg_basebackup/.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
/pg_basebackup
|
/pg_basebackup
|
||||||
/pg_receivexlog
|
/pg_receivewal
|
||||||
/pg_recvlogical
|
/pg_recvlogical
|
||||||
|
|
||||||
/tmp_check/
|
/tmp_check/
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
PGFILEDESC = "pg_basebackup/pg_receivexlog/pg_recvlogical - streaming WAL and backup receivers"
|
PGFILEDESC = "pg_basebackup/pg_receivewal/pg_recvlogical - streaming WAL and backup receivers"
|
||||||
PGAPPICON=win32
|
PGAPPICON=win32
|
||||||
|
|
||||||
EXTRA_INSTALL=contrib/test_decoding
|
EXTRA_INSTALL=contrib/test_decoding
|
||||||
@ -23,20 +23,20 @@ LDFLAGS += -L$(top_builddir)/src/fe_utils -lpgfeutils -lpq
|
|||||||
|
|
||||||
OBJS=receivelog.o streamutil.o walmethods.o $(WIN32RES)
|
OBJS=receivelog.o streamutil.o walmethods.o $(WIN32RES)
|
||||||
|
|
||||||
all: pg_basebackup pg_receivexlog pg_recvlogical
|
all: pg_basebackup pg_receivewal pg_recvlogical
|
||||||
|
|
||||||
pg_basebackup: pg_basebackup.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
|
pg_basebackup: pg_basebackup.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
|
||||||
$(CC) $(CFLAGS) pg_basebackup.o $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
$(CC) $(CFLAGS) pg_basebackup.o $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
pg_receivexlog: pg_receivexlog.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
|
pg_receivewal: pg_receivewal.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
|
||||||
$(CC) $(CFLAGS) pg_receivexlog.o $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
$(CC) $(CFLAGS) pg_receivewal.o $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
pg_recvlogical: pg_recvlogical.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
|
pg_recvlogical: pg_recvlogical.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
|
||||||
$(CC) $(CFLAGS) pg_recvlogical.o $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
$(CC) $(CFLAGS) pg_recvlogical.o $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
install: all installdirs
|
install: all installdirs
|
||||||
$(INSTALL_PROGRAM) pg_basebackup$(X) '$(DESTDIR)$(bindir)/pg_basebackup$(X)'
|
$(INSTALL_PROGRAM) pg_basebackup$(X) '$(DESTDIR)$(bindir)/pg_basebackup$(X)'
|
||||||
$(INSTALL_PROGRAM) pg_receivexlog$(X) '$(DESTDIR)$(bindir)/pg_receivexlog$(X)'
|
$(INSTALL_PROGRAM) pg_receivewal$(X) '$(DESTDIR)$(bindir)/pg_receivewal$(X)'
|
||||||
$(INSTALL_PROGRAM) pg_recvlogical$(X) '$(DESTDIR)$(bindir)/pg_recvlogical$(X)'
|
$(INSTALL_PROGRAM) pg_recvlogical$(X) '$(DESTDIR)$(bindir)/pg_recvlogical$(X)'
|
||||||
|
|
||||||
installdirs:
|
installdirs:
|
||||||
@ -44,12 +44,12 @@ installdirs:
|
|||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f '$(DESTDIR)$(bindir)/pg_basebackup$(X)'
|
rm -f '$(DESTDIR)$(bindir)/pg_basebackup$(X)'
|
||||||
rm -f '$(DESTDIR)$(bindir)/pg_receivexlog$(X)'
|
rm -f '$(DESTDIR)$(bindir)/pg_receivewal$(X)'
|
||||||
rm -f '$(DESTDIR)$(bindir)/pg_recvlogical$(X)'
|
rm -f '$(DESTDIR)$(bindir)/pg_recvlogical$(X)'
|
||||||
|
|
||||||
clean distclean maintainer-clean:
|
clean distclean maintainer-clean:
|
||||||
rm -f pg_basebackup$(X) pg_receivexlog$(X) pg_recvlogical$(X) \
|
rm -f pg_basebackup$(X) pg_receivewal$(X) pg_recvlogical$(X) \
|
||||||
pg_basebackup.o pg_receivexlog.o pg_recvlogical.o \
|
pg_basebackup.o pg_receivewal.o pg_recvlogical.o \
|
||||||
$(OBJS)
|
$(OBJS)
|
||||||
rm -rf tmp_check
|
rm -rf tmp_check
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# src/bin/pg_basebackup/nls.mk
|
# src/bin/pg_basebackup/nls.mk
|
||||||
CATALOG_NAME = pg_basebackup
|
CATALOG_NAME = pg_basebackup
|
||||||
AVAIL_LANGUAGES = de es fr it ko pl pt_BR ru zh_CN
|
AVAIL_LANGUAGES = de es fr it ko pl pt_BR ru zh_CN
|
||||||
GETTEXT_FILES = pg_basebackup.c pg_receivexlog.c pg_recvlogical.c receivelog.c streamutil.c ../../common/fe_memutils.c ../../common/file_utils.c
|
GETTEXT_FILES = pg_basebackup.c pg_receivewal.c pg_recvlogical.c receivelog.c streamutil.c ../../common/fe_memutils.c ../../common/file_utils.c
|
||||||
GETTEXT_TRIGGERS = simple_prompt
|
GETTEXT_TRIGGERS = simple_prompt
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* pg_receivexlog.c - receive streaming transaction log data and write it
|
* pg_receivewal.c - receive streaming transaction log data and write it
|
||||||
* to a local file.
|
* to a local file.
|
||||||
*
|
*
|
||||||
* Author: Magnus Hagander <magnus@hagander.net>
|
* Author: Magnus Hagander <magnus@hagander.net>
|
||||||
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* src/bin/pg_basebackup/pg_receivexlog.c
|
* src/bin/pg_basebackup/pg_receivewal.c
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ main(int argc, char **argv)
|
|||||||
else if (strcmp(argv[1], "-V") == 0 ||
|
else if (strcmp(argv[1], "-V") == 0 ||
|
||||||
strcmp(argv[1], "--version") == 0)
|
strcmp(argv[1], "--version") == 0)
|
||||||
{
|
{
|
||||||
puts("pg_receivexlog (PostgreSQL) " PG_VERSION);
|
puts("pg_receivewal (PostgreSQL) " PG_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
8
src/bin/pg_basebackup/t/020_pg_receivewal.pl
Normal file
8
src/bin/pg_basebackup/t/020_pg_receivewal.pl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use TestLib;
|
||||||
|
use Test::More tests => 8;
|
||||||
|
|
||||||
|
program_help_ok('pg_receivewal');
|
||||||
|
program_version_ok('pg_receivewal');
|
||||||
|
program_options_handling_ok('pg_receivewal');
|
@ -1,8 +0,0 @@
|
|||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use TestLib;
|
|
||||||
use Test::More tests => 8;
|
|
||||||
|
|
||||||
program_help_ok('pg_receivexlog');
|
|
||||||
program_version_ok('pg_receivexlog');
|
|
||||||
program_options_handling_ok('pg_receivexlog');
|
|
@ -39,7 +39,7 @@ struct WalWriteMethod
|
|||||||
* - WalDirectoryMethod - write WAL to regular files in a standard pg_xlog
|
* - WalDirectoryMethod - write WAL to regular files in a standard pg_xlog
|
||||||
* - TarDirectoryMethod - write WAL to a tarfile corresponding to pg_xlog
|
* - TarDirectoryMethod - write WAL to a tarfile corresponding to pg_xlog
|
||||||
* (only implements the methods required for pg_basebackup,
|
* (only implements the methods required for pg_basebackup,
|
||||||
* not all those required for pg_receivexlog)
|
* not all those required for pg_receivewal)
|
||||||
*/
|
*/
|
||||||
WalWriteMethod *CreateWalDirectoryMethod(const char *basedir,
|
WalWriteMethod *CreateWalDirectoryMethod(const char *basedir,
|
||||||
int compression, bool sync);
|
int compression, bool sync);
|
||||||
|
1
src/bin/pg_resetwal/.gitignore
vendored
Normal file
1
src/bin/pg_resetwal/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/pg_resetwal
|
@ -1,35 +1,35 @@
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Makefile for src/bin/pg_resetxlog
|
# Makefile for src/bin/pg_resetwal
|
||||||
#
|
#
|
||||||
# Copyright (c) 1998-2017, PostgreSQL Global Development Group
|
# Copyright (c) 1998-2017, PostgreSQL Global Development Group
|
||||||
#
|
#
|
||||||
# src/bin/pg_resetxlog/Makefile
|
# src/bin/pg_resetwal/Makefile
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
PGFILEDESC = "pg_resetxlog - reset PostgreSQL WAL log"
|
PGFILEDESC = "pg_resetwal - reset PostgreSQL WAL log"
|
||||||
PGAPPICON=win32
|
PGAPPICON=win32
|
||||||
|
|
||||||
subdir = src/bin/pg_resetxlog
|
subdir = src/bin/pg_resetwal
|
||||||
top_builddir = ../../..
|
top_builddir = ../../..
|
||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
|
||||||
OBJS= pg_resetxlog.o $(WIN32RES)
|
OBJS= pg_resetwal.o $(WIN32RES)
|
||||||
|
|
||||||
all: pg_resetxlog
|
all: pg_resetwal
|
||||||
|
|
||||||
pg_resetxlog: $(OBJS) | submake-libpgport
|
pg_resetwal: $(OBJS) | submake-libpgport
|
||||||
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
install: all installdirs
|
install: all installdirs
|
||||||
$(INSTALL_PROGRAM) pg_resetxlog$(X) '$(DESTDIR)$(bindir)/pg_resetxlog$(X)'
|
$(INSTALL_PROGRAM) pg_resetwal$(X) '$(DESTDIR)$(bindir)/pg_resetwal$(X)'
|
||||||
|
|
||||||
installdirs:
|
installdirs:
|
||||||
$(MKDIR_P) '$(DESTDIR)$(bindir)'
|
$(MKDIR_P) '$(DESTDIR)$(bindir)'
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f '$(DESTDIR)$(bindir)/pg_resetxlog$(X)'
|
rm -f '$(DESTDIR)$(bindir)/pg_resetwal$(X)'
|
||||||
|
|
||||||
clean distclean maintainer-clean:
|
clean distclean maintainer-clean:
|
||||||
rm -f pg_resetxlog$(X) $(OBJS)
|
rm -f pg_resetwal$(X) $(OBJS)
|
4
src/bin/pg_resetwal/nls.mk
Normal file
4
src/bin/pg_resetwal/nls.mk
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# src/bin/pg_resetwal/nls.mk
|
||||||
|
CATALOG_NAME = pg_resetwal
|
||||||
|
AVAIL_LANGUAGES = cs de es fr it ja ko pl pt_BR ru sv zh_CN
|
||||||
|
GETTEXT_FILES = pg_resetwal.c ../../common/restricted_token.c
|
@ -1,6 +1,6 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* pg_resetxlog.c
|
* pg_resetwal.c
|
||||||
* A utility to "zero out" the xlog when it's corrupt beyond recovery.
|
* A utility to "zero out" the xlog when it's corrupt beyond recovery.
|
||||||
* Can also rebuild pg_control if needed.
|
* Can also rebuild pg_control if needed.
|
||||||
*
|
*
|
||||||
@ -23,7 +23,7 @@
|
|||||||
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* src/bin/pg_resetxlog/pg_resetxlog.c
|
* src/bin/pg_resetwal/pg_resetwal.c
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -96,7 +96,7 @@ main(int argc, char *argv[])
|
|||||||
char *DataDir = NULL;
|
char *DataDir = NULL;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_resetxlog"));
|
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_resetwal"));
|
||||||
|
|
||||||
progname = get_progname(argv[0]);
|
progname = get_progname(argv[0]);
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
|
if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
|
||||||
{
|
{
|
||||||
puts("pg_resetxlog (PostgreSQL) " PG_VERSION);
|
puts("pg_resetwal (PostgreSQL) " PG_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't allow pg_resetxlog to be run as root, to avoid overwriting the
|
* Don't allow pg_resetwal to be run as root, to avoid overwriting the
|
||||||
* ownership of files in the data directory. We need only check for root
|
* ownership of files in the data directory. We need only check for root
|
||||||
* -- any other user won't have sufficient permissions to modify files in
|
* -- any other user won't have sufficient permissions to modify files in
|
||||||
* the data directory.
|
* the data directory.
|
||||||
@ -915,7 +915,7 @@ FindEndOfXLOG(void)
|
|||||||
/*
|
/*
|
||||||
* Note: We don't use XLogFromFileName here, because we want to
|
* Note: We don't use XLogFromFileName here, because we want to
|
||||||
* use the segment size from the control file, not the size the
|
* use the segment size from the control file, not the size the
|
||||||
* pg_resetxlog binary was compiled with
|
* pg_resetwal binary was compiled with
|
||||||
*/
|
*/
|
||||||
sscanf(xlde->d_name, "%08X%08X%08X", &tli, &log, &seg);
|
sscanf(xlde->d_name, "%08X%08X%08X", &tli, &log, &seg);
|
||||||
segno = ((uint64) log) * segs_per_xlogid + seg;
|
segno = ((uint64) log) * segs_per_xlogid + seg;
|
1
src/bin/pg_resetxlog/.gitignore
vendored
1
src/bin/pg_resetxlog/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/pg_resetxlog
|
|
@ -1,4 +0,0 @@
|
|||||||
# src/bin/pg_resetxlog/nls.mk
|
|
||||||
CATALOG_NAME = pg_resetxlog
|
|
||||||
AVAIL_LANGUAGES = cs de es fr it ja ko pl pt_BR ru sv zh_CN
|
|
||||||
GETTEXT_FILES = pg_resetxlog.c ../../common/restricted_token.c
|
|
@ -18,16 +18,16 @@
|
|||||||
*
|
*
|
||||||
* gets pg_control information in "ctrl". Assumes that bindir and
|
* gets pg_control information in "ctrl". Assumes that bindir and
|
||||||
* datadir are valid absolute paths to postgresql bin and pgdata
|
* datadir are valid absolute paths to postgresql bin and pgdata
|
||||||
* directories respectively *and* pg_resetxlog is version compatible
|
* directories respectively *and* pg_resetwal is version compatible
|
||||||
* with datadir. The main purpose of this function is to get pg_control
|
* with datadir. The main purpose of this function is to get pg_control
|
||||||
* data in a version independent manner.
|
* data in a version independent manner.
|
||||||
*
|
*
|
||||||
* The approach taken here is to invoke pg_resetxlog with -n option
|
* The approach taken here is to invoke pg_resetwal with -n option
|
||||||
* and then pipe its output. With little string parsing we get the
|
* and then pipe its output. With little string parsing we get the
|
||||||
* pg_control data. pg_resetxlog cannot be run while the server is running
|
* pg_control data. pg_resetwal cannot be run while the server is running
|
||||||
* so we use pg_controldata; pg_controldata doesn't provide all the fields
|
* so we use pg_controldata; pg_controldata doesn't provide all the fields
|
||||||
* we need to actually perform the upgrade, but it provides enough for
|
* we need to actually perform the upgrade, but it provides enough for
|
||||||
* check mode. We do not implement pg_resetxlog -n because it is hard to
|
* check mode. We do not implement pg_resetwal -n because it is hard to
|
||||||
* return valid xid data for a running server.
|
* return valid xid data for a running server.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -73,7 +73,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Because we test the pg_resetxlog output as strings, it has to be in
|
* Because we test the pg_resetwal output as strings, it has to be in
|
||||||
* English. Copied from pg_regress.c.
|
* English. Copied from pg_regress.c.
|
||||||
*/
|
*/
|
||||||
if (getenv("LC_COLLATE"))
|
if (getenv("LC_COLLATE"))
|
||||||
@ -113,7 +113,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
|
|||||||
|
|
||||||
snprintf(cmd, sizeof(cmd), "\"%s/%s \"%s\"",
|
snprintf(cmd, sizeof(cmd), "\"%s/%s \"%s\"",
|
||||||
cluster->bindir,
|
cluster->bindir,
|
||||||
live_check ? "pg_controldata\"" : "pg_resetxlog\" -n",
|
live_check ? "pg_controldata\"" : "pg_resetwal\" -n",
|
||||||
cluster->pgdata);
|
cluster->pgdata);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
@ -139,7 +139,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
|
|||||||
p = strchr(p, ':');
|
p = strchr(p, ':');
|
||||||
|
|
||||||
if (p == NULL || strlen(p) <= 1)
|
if (p == NULL || strlen(p) <= 1)
|
||||||
pg_fatal("%d: pg_resetxlog problem\n", __LINE__);
|
pg_fatal("%d: pg_resetwal problem\n", __LINE__);
|
||||||
|
|
||||||
p++; /* remove ':' char */
|
p++; /* remove ':' char */
|
||||||
cluster->controldata.ctrl_ver = str2uint(p);
|
cluster->controldata.ctrl_ver = str2uint(p);
|
||||||
@ -440,7 +440,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
|
|||||||
pg_free(lc_messages);
|
pg_free(lc_messages);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Before 9.3, pg_resetxlog reported the xlogid and segno of the first log
|
* Before 9.3, pg_resetwal reported the xlogid and segno of the first log
|
||||||
* file after reset as separate lines. Starting with 9.3, it reports the
|
* file after reset as separate lines. Starting with 9.3, it reports the
|
||||||
* WAL file name. If the old cluster is older than 9.3, we construct the
|
* WAL file name. If the old cluster is older than 9.3, we construct the
|
||||||
* WAL file name from the xlogid and segno.
|
* WAL file name from the xlogid and segno.
|
||||||
|
@ -335,7 +335,7 @@ check_bin_dir(ClusterInfo *cluster)
|
|||||||
|
|
||||||
validate_exec(cluster->bindir, "postgres");
|
validate_exec(cluster->bindir, "postgres");
|
||||||
validate_exec(cluster->bindir, "pg_ctl");
|
validate_exec(cluster->bindir, "pg_ctl");
|
||||||
validate_exec(cluster->bindir, "pg_resetxlog");
|
validate_exec(cluster->bindir, "pg_resetwal");
|
||||||
if (cluster == &new_cluster)
|
if (cluster == &new_cluster)
|
||||||
{
|
{
|
||||||
/* these are only needed in the new cluster */
|
/* these are only needed in the new cluster */
|
||||||
|
@ -147,7 +147,7 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
prep_status("Setting next OID for new cluster");
|
prep_status("Setting next OID for new cluster");
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_resetxlog\" -o %u \"%s\"",
|
"\"%s/pg_resetwal\" -o %u \"%s\"",
|
||||||
new_cluster.bindir, old_cluster.controldata.chkpnt_nxtoid,
|
new_cluster.bindir, old_cluster.controldata.chkpnt_nxtoid,
|
||||||
new_cluster.pgdata);
|
new_cluster.pgdata);
|
||||||
check_ok();
|
check_ok();
|
||||||
@ -408,16 +408,16 @@ copy_clog_xlog_xid(void)
|
|||||||
/* set the next transaction id and epoch of the new cluster */
|
/* set the next transaction id and epoch of the new cluster */
|
||||||
prep_status("Setting next transaction ID and epoch for new cluster");
|
prep_status("Setting next transaction ID and epoch for new cluster");
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_resetxlog\" -f -x %u \"%s\"",
|
"\"%s/pg_resetwal\" -f -x %u \"%s\"",
|
||||||
new_cluster.bindir, old_cluster.controldata.chkpnt_nxtxid,
|
new_cluster.bindir, old_cluster.controldata.chkpnt_nxtxid,
|
||||||
new_cluster.pgdata);
|
new_cluster.pgdata);
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_resetxlog\" -f -e %u \"%s\"",
|
"\"%s/pg_resetwal\" -f -e %u \"%s\"",
|
||||||
new_cluster.bindir, old_cluster.controldata.chkpnt_nxtepoch,
|
new_cluster.bindir, old_cluster.controldata.chkpnt_nxtepoch,
|
||||||
new_cluster.pgdata);
|
new_cluster.pgdata);
|
||||||
/* must reset commit timestamp limits also */
|
/* must reset commit timestamp limits also */
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_resetxlog\" -f -c %u,%u \"%s\"",
|
"\"%s/pg_resetwal\" -f -c %u,%u \"%s\"",
|
||||||
new_cluster.bindir,
|
new_cluster.bindir,
|
||||||
old_cluster.controldata.chkpnt_nxtxid,
|
old_cluster.controldata.chkpnt_nxtxid,
|
||||||
old_cluster.controldata.chkpnt_nxtxid,
|
old_cluster.controldata.chkpnt_nxtxid,
|
||||||
@ -443,7 +443,7 @@ copy_clog_xlog_xid(void)
|
|||||||
* counters here and the oldest multi present on system.
|
* counters here and the oldest multi present on system.
|
||||||
*/
|
*/
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_resetxlog\" -O %u -m %u,%u \"%s\"",
|
"\"%s/pg_resetwal\" -O %u -m %u,%u \"%s\"",
|
||||||
new_cluster.bindir,
|
new_cluster.bindir,
|
||||||
old_cluster.controldata.chkpnt_nxtmxoff,
|
old_cluster.controldata.chkpnt_nxtmxoff,
|
||||||
old_cluster.controldata.chkpnt_nxtmulti,
|
old_cluster.controldata.chkpnt_nxtmulti,
|
||||||
@ -471,7 +471,7 @@ copy_clog_xlog_xid(void)
|
|||||||
* next=MaxMultiXactId, but multixact.c can cope with that just fine.
|
* next=MaxMultiXactId, but multixact.c can cope with that just fine.
|
||||||
*/
|
*/
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_resetxlog\" -m %u,%u \"%s\"",
|
"\"%s/pg_resetwal\" -m %u,%u \"%s\"",
|
||||||
new_cluster.bindir,
|
new_cluster.bindir,
|
||||||
old_cluster.controldata.chkpnt_nxtmulti + 1,
|
old_cluster.controldata.chkpnt_nxtmulti + 1,
|
||||||
old_cluster.controldata.chkpnt_nxtmulti,
|
old_cluster.controldata.chkpnt_nxtmulti,
|
||||||
@ -483,7 +483,7 @@ copy_clog_xlog_xid(void)
|
|||||||
prep_status("Resetting WAL archives");
|
prep_status("Resetting WAL archives");
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
/* use timeline 1 to match controldata and no WAL history file */
|
/* use timeline 1 to match controldata and no WAL history file */
|
||||||
"\"%s/pg_resetxlog\" -l 00000001%s \"%s\"", new_cluster.bindir,
|
"\"%s/pg_resetwal\" -l 00000001%s \"%s\"", new_cluster.bindir,
|
||||||
old_cluster.controldata.nextxlogfile + 8,
|
old_cluster.controldata.nextxlogfile + 8,
|
||||||
new_cluster.pgdata);
|
new_cluster.pgdata);
|
||||||
check_ok();
|
check_ok();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/pg_xlogdump
|
/pg_waldump
|
||||||
# Source files copied from src/backend/access/rmgrdesc/
|
# Source files copied from src/backend/access/rmgrdesc/
|
||||||
/*desc.c
|
/*desc.c
|
||||||
/xlogreader.c
|
/xlogreader.c
|
@ -1,13 +1,13 @@
|
|||||||
# src/bin/pg_xlogdump/Makefile
|
# src/bin/pg_waldump/Makefile
|
||||||
|
|
||||||
PGFILEDESC = "pg_xlogdump - decode and display WAL"
|
PGFILEDESC = "pg_waldump - decode and display WAL"
|
||||||
PGAPPICON=win32
|
PGAPPICON=win32
|
||||||
|
|
||||||
subdir = src/bin/pg_xlogdump
|
subdir = src/bin/pg_waldump
|
||||||
top_builddir = ../../..
|
top_builddir = ../../..
|
||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
|
||||||
OBJS = pg_xlogdump.o compat.o xlogreader.o rmgrdesc.o \
|
OBJS = pg_waldump.o compat.o xlogreader.o rmgrdesc.o \
|
||||||
$(RMGRDESCOBJS) $(WIN32RES)
|
$(RMGRDESCOBJS) $(WIN32RES)
|
||||||
|
|
||||||
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
|
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
|
||||||
@ -16,9 +16,9 @@ RMGRDESCSOURCES = $(sort $(notdir $(wildcard $(top_srcdir)/src/backend/access/rm
|
|||||||
RMGRDESCOBJS = $(patsubst %.c,%.o,$(RMGRDESCSOURCES))
|
RMGRDESCOBJS = $(patsubst %.c,%.o,$(RMGRDESCSOURCES))
|
||||||
|
|
||||||
|
|
||||||
all: pg_xlogdump
|
all: pg_waldump
|
||||||
|
|
||||||
pg_xlogdump: $(OBJS) | submake-libpgport
|
pg_waldump: $(OBJS) | submake-libpgport
|
||||||
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
xlogreader.c: % : $(top_srcdir)/src/backend/access/transam/%
|
xlogreader.c: % : $(top_srcdir)/src/backend/access/transam/%
|
||||||
@ -28,13 +28,13 @@ $(RMGRDESCSOURCES): % : $(top_srcdir)/src/backend/access/rmgrdesc/%
|
|||||||
rm -f $@ && $(LN_S) $< .
|
rm -f $@ && $(LN_S) $< .
|
||||||
|
|
||||||
install: all installdirs
|
install: all installdirs
|
||||||
$(INSTALL_PROGRAM) pg_xlogdump$(X) '$(DESTDIR)$(bindir)/pg_xlogdump$(X)'
|
$(INSTALL_PROGRAM) pg_waldump$(X) '$(DESTDIR)$(bindir)/pg_waldump$(X)'
|
||||||
|
|
||||||
installdirs:
|
installdirs:
|
||||||
$(MKDIR_P) '$(DESTDIR)$(bindir)'
|
$(MKDIR_P) '$(DESTDIR)$(bindir)'
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f '$(DESTDIR)$(bindir)/pg_xlogdump$(X)'
|
rm -f '$(DESTDIR)$(bindir)/pg_waldump$(X)'
|
||||||
|
|
||||||
clean distclean maintainer-clean:
|
clean distclean maintainer-clean:
|
||||||
rm -f pg_xlogdump$(X) $(OBJS) $(RMGRDESCSOURCES) xlogreader.c
|
rm -f pg_waldump$(X) $(OBJS) $(RMGRDESCSOURCES) xlogreader.c
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
|
* Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* src/bin/pg_xlogdump/compat.c
|
* src/bin/pg_waldump/compat.c
|
||||||
*
|
*
|
||||||
* This file contains client-side implementations for various backend
|
* This file contains client-side implementations for various backend
|
||||||
* functions that the rm_desc functions in *desc.c files rely on.
|
* functions that the rm_desc functions in *desc.c files rely on.
|
6
src/bin/pg_waldump/nls.mk
Normal file
6
src/bin/pg_waldump/nls.mk
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# src/bin/pg_waldump/nls.mk
|
||||||
|
CATALOG_NAME = pg_waldump
|
||||||
|
AVAIL_LANGUAGES =
|
||||||
|
GETTEXT_FILES = pg_waldump.c
|
||||||
|
GETTEXT_TRIGGERS = fatal_error
|
||||||
|
GETTEXT_FLAGS = fatal_error:1:c-format
|
@ -1,11 +1,11 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* pg_xlogdump.c - decode and display WAL
|
* pg_waldump.c - decode and display WAL
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2017, PostgreSQL Global Development Group
|
* Copyright (c) 2013-2017, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* src/bin/pg_xlogdump/pg_xlogdump.c
|
* src/bin/pg_waldump/pg_waldump.c
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ main(int argc, char **argv)
|
|||||||
int option;
|
int option;
|
||||||
int optindex = 0;
|
int optindex = 0;
|
||||||
|
|
||||||
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_xlogdump"));
|
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_waldump"));
|
||||||
progname = get_progname(argv[0]);
|
progname = get_progname(argv[0]);
|
||||||
|
|
||||||
memset(&private, 0, sizeof(XLogDumpPrivate));
|
memset(&private, 0, sizeof(XLogDumpPrivate));
|
||||||
@ -845,7 +845,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
puts("pg_xlogdump (PostgreSQL) " PG_VERSION);
|
puts("pg_waldump (PostgreSQL) " PG_VERSION);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* rmgrdesc.c
|
* rmgrdesc.c
|
||||||
*
|
*
|
||||||
* pg_xlogdump resource managers definition
|
* pg_waldump resource managers definition
|
||||||
*
|
*
|
||||||
* src/bin/pg_xlogdump/rmgrdesc.c
|
* src/bin/pg_waldump/rmgrdesc.c
|
||||||
*/
|
*/
|
||||||
#define FRONTEND 1
|
#define FRONTEND 1
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* rmgrdesc.h
|
* rmgrdesc.h
|
||||||
*
|
*
|
||||||
* pg_xlogdump resource managers declaration
|
* pg_waldump resource managers declaration
|
||||||
*
|
*
|
||||||
* src/bin/pg_xlogdump/rmgrdesc.h
|
* src/bin/pg_waldump/rmgrdesc.h
|
||||||
*/
|
*/
|
||||||
#ifndef RMGRDESC_H
|
#ifndef RMGRDESC_H
|
||||||
#define RMGRDESC_H
|
#define RMGRDESC_H
|
@ -1,6 +0,0 @@
|
|||||||
# src/bin/pg_xlogdump/nls.mk
|
|
||||||
CATALOG_NAME = pg_xlogdump
|
|
||||||
AVAIL_LANGUAGES =
|
|
||||||
GETTEXT_FILES = pg_xlogdump.c
|
|
||||||
GETTEXT_TRIGGERS = fatal_error
|
|
||||||
GETTEXT_FLAGS = fatal_error:1:c-format
|
|
@ -9,7 +9,7 @@
|
|||||||
* So the XLogRecord typedef and associated stuff appear in xlogrecord.h.
|
* So the XLogRecord typedef and associated stuff appear in xlogrecord.h.
|
||||||
*
|
*
|
||||||
* Note: This file must be includable in both frontend and backend contexts,
|
* Note: This file must be includable in both frontend and backend contexts,
|
||||||
* to allow stand-alone tools like pg_receivexlog to deal with WAL files.
|
* to allow stand-alone tools like pg_receivewal to deal with WAL files.
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
@ -153,7 +153,7 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
|
|||||||
strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN)
|
strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XLOG segment with .partial suffix. Used by pg_receivexlog and at end of
|
* XLOG segment with .partial suffix. Used by pg_receivewal and at end of
|
||||||
* archive recovery, when we want to archive a WAL segment but it might not
|
* archive recovery, when we want to archive a WAL segment but it might not
|
||||||
* be complete yet.
|
* be complete yet.
|
||||||
*/
|
*/
|
||||||
|
@ -237,7 +237,7 @@ extern void FreeAccessStrategy(BufferAccessStrategy strategy);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Although this header file is nominally backend-only, certain frontend
|
* Although this header file is nominally backend-only, certain frontend
|
||||||
* programs like pg_xlogdump include it. For compilers that emit static
|
* programs like pg_waldump include it. For compilers that emit static
|
||||||
* inline functions even when they're unused, that leads to unsatisfied
|
* inline functions even when they're unused, that leads to unsatisfied
|
||||||
* external references; hence hide these with #ifndef FRONTEND.
|
* external references; hence hide these with #ifndef FRONTEND.
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,7 @@ my @client_program_files = (
|
|||||||
'dropdb', 'droplang', 'dropuser', 'ecpg',
|
'dropdb', 'droplang', 'dropuser', 'ecpg',
|
||||||
'libecpg', 'libecpg_compat', 'libpgtypes', 'libpq',
|
'libecpg', 'libecpg_compat', 'libpgtypes', 'libpq',
|
||||||
'pg_basebackup', 'pg_config', 'pg_dump', 'pg_dumpall',
|
'pg_basebackup', 'pg_config', 'pg_dump', 'pg_dumpall',
|
||||||
'pg_isready', 'pg_receivexlog', 'pg_recvlogical', 'pg_restore',
|
'pg_isready', 'pg_receivewal', 'pg_recvlogical', 'pg_restore',
|
||||||
'psql', 'reindexdb', 'vacuumdb', @client_contribs);
|
'psql', 'reindexdb', 'vacuumdb', @client_contribs);
|
||||||
|
|
||||||
sub lcopy
|
sub lcopy
|
||||||
|
@ -54,11 +54,11 @@ my @frontend_uselibpq = ('pg_ctl', 'pg_upgrade', 'pgbench', 'psql', 'initdb');
|
|||||||
my @frontend_uselibpgport = (
|
my @frontend_uselibpgport = (
|
||||||
'pg_archivecleanup', 'pg_test_fsync',
|
'pg_archivecleanup', 'pg_test_fsync',
|
||||||
'pg_test_timing', 'pg_upgrade',
|
'pg_test_timing', 'pg_upgrade',
|
||||||
'pg_xlogdump', 'pgbench');
|
'pg_waldump', 'pgbench');
|
||||||
my @frontend_uselibpgcommon = (
|
my @frontend_uselibpgcommon = (
|
||||||
'pg_archivecleanup', 'pg_test_fsync',
|
'pg_archivecleanup', 'pg_test_fsync',
|
||||||
'pg_test_timing', 'pg_upgrade',
|
'pg_test_timing', 'pg_upgrade',
|
||||||
'pg_xlogdump', 'pgbench');
|
'pg_waldump', 'pgbench');
|
||||||
my $frontend_extralibs = {
|
my $frontend_extralibs = {
|
||||||
'initdb' => ['ws2_32.lib'],
|
'initdb' => ['ws2_32.lib'],
|
||||||
'pg_restore' => ['ws2_32.lib'],
|
'pg_restore' => ['ws2_32.lib'],
|
||||||
@ -73,7 +73,7 @@ my $frontend_extrasource = {
|
|||||||
[ 'src/bin/pgbench/exprscan.l', 'src/bin/pgbench/exprparse.y' ] };
|
[ 'src/bin/pgbench/exprscan.l', 'src/bin/pgbench/exprparse.y' ] };
|
||||||
my @frontend_excludes = (
|
my @frontend_excludes = (
|
||||||
'pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump',
|
'pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump',
|
||||||
'pg_xlogdump', 'scripts');
|
'pg_waldump', 'scripts');
|
||||||
|
|
||||||
sub mkvcbuild
|
sub mkvcbuild
|
||||||
{
|
{
|
||||||
@ -324,10 +324,10 @@ sub mkvcbuild
|
|||||||
$pgbasebackup->AddFile('src/bin/pg_basebackup/pg_basebackup.c');
|
$pgbasebackup->AddFile('src/bin/pg_basebackup/pg_basebackup.c');
|
||||||
$pgbasebackup->AddLibrary('ws2_32.lib');
|
$pgbasebackup->AddLibrary('ws2_32.lib');
|
||||||
|
|
||||||
my $pgreceivexlog = AddSimpleFrontend('pg_basebackup', 1);
|
my $pgreceivewal = AddSimpleFrontend('pg_basebackup', 1);
|
||||||
$pgreceivexlog->{name} = 'pg_receivexlog';
|
$pgreceivewal->{name} = 'pg_receivewal';
|
||||||
$pgreceivexlog->AddFile('src/bin/pg_basebackup/pg_receivexlog.c');
|
$pgreceivewal->AddFile('src/bin/pg_basebackup/pg_receivewal.c');
|
||||||
$pgreceivexlog->AddLibrary('ws2_32.lib');
|
$pgreceivewal->AddLibrary('ws2_32.lib');
|
||||||
|
|
||||||
my $pgrecvlogical = AddSimpleFrontend('pg_basebackup', 1);
|
my $pgrecvlogical = AddSimpleFrontend('pg_basebackup', 1);
|
||||||
$pgrecvlogical->{name} = 'pg_recvlogical';
|
$pgrecvlogical->{name} = 'pg_recvlogical';
|
||||||
@ -631,15 +631,15 @@ sub mkvcbuild
|
|||||||
$pgregress->AddDirResourceFile('src/test/regress');
|
$pgregress->AddDirResourceFile('src/test/regress');
|
||||||
$pgregress->AddReference($libpgcommon, $libpgport);
|
$pgregress->AddReference($libpgcommon, $libpgport);
|
||||||
|
|
||||||
# fix up pg_xlogdump once it's been set up
|
# fix up pg_waldump once it's been set up
|
||||||
# files symlinked on Unix are copied on windows
|
# files symlinked on Unix are copied on windows
|
||||||
my $pg_xlogdump = AddSimpleFrontend('pg_xlogdump');
|
my $pg_waldump = AddSimpleFrontend('pg_waldump');
|
||||||
$pg_xlogdump->AddDefine('FRONTEND');
|
$pg_waldump->AddDefine('FRONTEND');
|
||||||
foreach my $xf (glob('src/backend/access/rmgrdesc/*desc.c'))
|
foreach my $xf (glob('src/backend/access/rmgrdesc/*desc.c'))
|
||||||
{
|
{
|
||||||
$pg_xlogdump->AddFile($xf);
|
$pg_waldump->AddFile($xf);
|
||||||
}
|
}
|
||||||
$pg_xlogdump->AddFile('src/backend/access/transam/xlogreader.c');
|
$pg_waldump->AddFile('src/backend/access/transam/xlogreader.c');
|
||||||
|
|
||||||
$solution->Save();
|
$solution->Save();
|
||||||
return $solution->{vcver};
|
return $solution->{vcver};
|
||||||
|
Reference in New Issue
Block a user