diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml
new file mode 100644
index df84054..6bbac8c
*** a/doc/src/sgml/ref/allfiles.sgml
--- b/doc/src/sgml/ref/allfiles.sgml
*************** Complete list of usable sgml source file
*** 175,180 ****
--- 175,181 ----
  <!ENTITY pgCtl              SYSTEM "pg_ctl-ref.sgml">
  <!ENTITY pgDump             SYSTEM "pg_dump.sgml">
  <!ENTITY pgDumpall          SYSTEM "pg_dumpall.sgml">
+ <!ENTITY pgPing             SYSTEM "pg_ping-ref.sgml">
  <!ENTITY pgReceivexlog      SYSTEM "pg_receivexlog.sgml">
  <!ENTITY pgResetxlog        SYSTEM "pg_resetxlog.sgml">
  <!ENTITY pgRestore          SYSTEM "pg_restore.sgml">
diff --git a/doc/src/sgml/ref/pg_ping-ref.sgml b/doc/src/sgml/ref/pg_ping-ref.sgml
new file mode 100644
index ...ef77d16
*** a/doc/src/sgml/ref/pg_ping-ref.sgml
--- b/doc/src/sgml/ref/pg_ping-ref.sgml
***************
*** 0 ****
--- 1,163 ----
+ <!--
+ doc/src/sgml/ref/pg_ping-ref.sgml
+ PostgreSQL documentation
+ -->
+ 
+ <refentry id="app-pg-ping">
+  <refmeta>
+   <refentrytitle><application>pg_ping</application></refentrytitle>
+   <manvolnum>1</manvolnum>
+   <refmiscinfo>Application</refmiscinfo>
+  </refmeta>
+ 
+  <refnamediv>
+   <refname>pg_ping</refname>
+   <refpurpose>checks the connection status of a <productname>PostgreSQL</productname> server</refpurpose>
+  </refnamediv>
+ 
+  <indexterm zone="app-pg-ping">
+   <primary>pg_ping</primary>
+  </indexterm>
+ 
+  <refsynopsisdiv>
+   <cmdsynopsis>
+    <command>pg_ping</command>
+    <arg rep="repeat"><replaceable>connection-option</replaceable></arg>
+    <arg rep="repeat"><replaceable>option</replaceable></arg>
+   </cmdsynopsis>
+  </refsynopsisdiv>
+ 
+ 
+  <refsect1 id="app-pg-ping-description">
+   <title>Description</title>
+   <para>
+    <application>pg_ping</application> is a utility for checking the connection
+    status of a <productname>PostgreSQL</productname> database server. The exit
+    status specifies the result of the connection check.
+   </para>
+  </refsect1>
+ 
+  <refsect1 id="app-pg-ping-options">
+   <title>Options</title>
+ 
+     <variablelist>
+ 
+      <varlistentry>
+        <term><option>-h <replaceable class="parameter">hostname</replaceable></></term>
+        <term><option>--host=<replaceable class="parameter">hostname</replaceable></></term>
+        <listitem>
+        <para>
+        Specifies the host name of the machine on which the
+        server is running. If the value begins
+        with a slash, it is used as the directory for the Unix-domain
+        socket.
+        </para>
+        </listitem>
+      </varlistentry>
+ 
+      <varlistentry>
+        <term><option>-p <replaceable class="parameter">port</replaceable></></term>
+        <term><option>--port=<replaceable class="parameter">port</replaceable></></term>
+        <listitem>
+        <para>
+        Specifies the TCP port or the local Unix-domain
+        socket file extension on which the server is listening for
+        connections. Defaults to the value of the <envar>PGPORT</envar>
+        environment variable or, if not set, to the port specified at
+        compile time, usually 5432.
+        </para>
+        </listitem>
+      </varlistentry>
+ 
+      <varlistentry>
+        <term><option>-U <replaceable class="parameter">username</replaceable></></term>
+        <term><option>--username=<replaceable class="parameter">username</replaceable></></term>
+        <listitem>
+        <para>
+        Connect to the database as the user <replaceable
+        class="parameter">username</replaceable> instead of the default.
+        </para>
+        </listitem>
+      </varlistentry>
+ 
+      <varlistentry>
+       <term><option>-v</option></term>
+       <term><option>--verbose</option></term>
+       <listitem>
+        <para>
+         Enables verbose mode. Will output the result of the operation as well as the
+         connection parameters used.
+        </para>
+       </listitem>
+      </varlistentry>
+ 
+      <varlistentry>
+       <term><option>-V</></term>
+       <term><option>--version</></term>
+        <listitem>
+         <para>
+          Print the <application>pg_ping</application> version and exit.
+         </para>
+        </listitem>
+      </varlistentry>
+ 
+      <varlistentry>
+       <term><option>-?</></term>
+       <term><option>--help</></term>
+       <listitem>
+        <para>
+         Show help about <application>pg_ping</application> command line
+         arguments, and exit.
+        </para>
+       </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+ 
+  <refsect1>
+   <title>Exit Status</title>
+ 
+   <para>
+    <application>pg_ping</application> returns 0 to the shell if the server
+    is accepting connections normally, 1 if the server is rejecting
+    conntections (for example during startup), 2 if there was no response to the
+    connection attempt, and 3 if no attempt was made (for example due to invalid
+    parameters).
+   </para>
+  </refsect1>
+ 
+  <refsect1>
+   <title>Environment</title>
+ 
+   <para>
+    <command>pg_ping</command>, like most other <productname>PostgreSQL</>
+    utilities,
+    also uses the environment variables supported by <application>libpq</>
+    (see <xref linkend="libpq-envars">).
+   </para>
+  </refsect1>
+ 
+ 
+  <refsect1 id="app-pg-ping-examples">
+   <title>Examples</title>
+ 
+   <para>
+    Standard Usage:
+    <screen>
+     <prompt>$</prompt> <userinput>pg_ping</userinput>
+     <prompt>$</prompt> <userinput>echo $?</userinput>
+     <computeroutput>0</computeroutput>
+    </screen>
+   </para>
+ 
+   <para>
+    To run in verbose mode with connection parameters:
+    <screen>
+     <prompt>$ </prompt><userinput>pg_ping -v -U postgres -h localhost</userinput>
+     <computeroutput>postgres@localhost:5432 - Accepting Conections</computeroutput>
+    </screen>
+   </para>
+ 
+  </refsect1>
+ 
+ </refentry>
diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml
new file mode 100644
index 0872168..7dcf5c9
*** a/doc/src/sgml/reference.sgml
--- b/doc/src/sgml/reference.sgml
***************
*** 247,252 ****
--- 247,253 ----
     &initdb;
     &pgControldata;
     &pgCtl;
+    &pgPing;
     &pgResetxlog;
     &postgres;
     &postmaster;