Index: appendices/symlinks/rc0.xml
===================================================================
--- appendices/symlinks/rc0.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc0.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -72,7 +72,7 @@
 <row>
 <entry>K26</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Shut down PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Shut down PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: appendices/symlinks/rc1.xml
===================================================================
--- appendices/symlinks/rc1.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc1.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -58,7 +58,7 @@
 <row>
 <entry>K26</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Shut down PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Shut down PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: appendices/symlinks/rc2.xml
===================================================================
--- appendices/symlinks/rc2.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc2.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -51,7 +51,7 @@
 <row>
 <entry>K26</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Shut down PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Shut down PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: appendices/symlinks/rc3.xml
===================================================================
--- appendices/symlinks/rc3.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc3.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -121,7 +121,7 @@
 <row>
 <entry>S34</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Start PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Start PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: appendices/symlinks/rc4.xml
===================================================================
--- appendices/symlinks/rc4.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc4.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -121,7 +121,7 @@
 <row>
 <entry>S34</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Start PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Start PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: appendices/symlinks/rc5.xml
===================================================================
--- appendices/symlinks/rc5.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc5.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -114,7 +114,7 @@
 <row>
 <entry>S34</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Start PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Start PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: appendices/symlinks/rc6.xml
===================================================================
--- appendices/symlinks/rc6.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ appendices/symlinks/rc6.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -65,7 +65,7 @@
 <row>
 <entry>K26</entry>
-<entry>postgres</entry>
-<entry><filename>../init.d/postgres</filename></entry>
-<entry>Shut down PostgreSQL Daemon: <xref linkend="postgres"/></entry>
+<entry>postgresql</entry>
+<entry><filename>../init.d/postgresql</filename></entry>
+<entry>Shut down PostgreSQL Daemon: <xref linkend="postgresql"/></entry>
 </row>
 
Index: content/content.ent
===================================================================
--- content/content.ent	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ content/content.ent	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -6,9 +6,9 @@
 <!ENTITY % db-3.3 SYSTEM "databases/db-3.3/db-3.3.ent">
 <!ENTITY % mysql SYSTEM "databases/mysql/mysql.ent">
-<!ENTITY % postgres SYSTEM "databases/postgres/postgres.ent">
+<!ENTITY % postgresql SYSTEM "databases/postgresql/postgresql.ent">
 %db;
 %db-3.3;
 %mysql;
-%postgres;
+%postgresql;
 
 <!-- Web server software -->
Index: content/databases/databases.xml
===================================================================
--- content/databases/databases.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ content/databases/databases.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -12,5 +12,5 @@
 &db-3.3;
 &mysql;
-&postgres;
+&postgresql;
 
 </chapter>
Index: ntent/databases/postgres.xml
===================================================================
--- content/databases/postgres.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ 	(revision )
@@ -1,11 +1,0 @@
-<sect1 id="postgres" xreflabel="PostgreSQL-&postgres-version;">
-<?dbhtml filename="postgres.html" dir="content"?>
-<title>Postgre<acronym>SQL</acronym>-&postgres-version;</title>
-
-&postgres-intro;
-&postgres-inst;
-&postgres-exp;
-&postgres-config;
-&postgres-desc;
-
-</sect1>
Index: content/databases/postgresql.xml
===================================================================
--- content/databases/postgresql.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,11 @@
+<sect1 id="postgresql" xreflabel="PostgreSQL-&postgresql-version;">
+<?dbhtml filename="postgresql.html" dir="content"?>
+<title>Postgre<acronym>SQL</acronym>-&postgresql-version;</title>
+
+&postgresql-intro;
+&postgresql-inst;
+&postgresql-exp;
+&postgresql-config;
+&postgresql-desc;
+
+</sect1>
Index: content/databases/postgresql/postgresql-config.xml
===================================================================
--- content/databases/postgresql/postgresql-config.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql/postgresql-config.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,78 @@
+<sect2>
+<title>Configuring <application>Postgre<acronym>SQL</acronym></application></title>
+
+<sect3>
+<title>Config files</title>
+
+<para><filename>$PGDATA/pg_ident.con</filename>, <filename>$PGDATA/pg_hba.conf</filename>, <filename>$PGDATA/postgresql.conf</filename></para>
+
+<para>The <envar>PGDATA</envar> environment variable is used to distinguish database
+clusters from one another by setting it to the value of the directory
+which contains the cluster desired. The three configuration files
+exist in every <filename class="directory">PGDATA/</filename> directory. 
+Details on the format of the files and the options that can be set in 
+each can be found in <ulink
+url="file:///usr/share/doc/postgresql/html/index.html"/>.</para>
+
+<para>Create the boot script with the following: </para>
+
+<screen><userinput><command>cat &gt; /etc/rc.d/init.d/postgresql &lt;&lt; "EOF"</command>
+#!/bin/bash
+# Begin $rc_base/init.d/postgresql
+
+# Based on sysklogd script from LFS-3.1 and earlier.
+# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
+
+source /etc/sysconfig/rc
+source $rc_functions
+
+case "$1" in
+        start)
+                echo "Starting PostgreSQL daemon..."
+		su - postgres -c '/usr/bin/pg_ctl start -W -D /var/pgsql/data \
+                               -l /var/pgsql/data/logfile -o "-i" '
+                evaluate_retval
+                ;;
+
+        stop)
+                echo "Stopping PostgreSQL daemon..."
+                /usr/bin/pg_ctl stop -m smart -D /var/pgsql/data
+		evaluate_retval
+                ;;
+
+        restart)
+                $0 stop
+                sleep 1
+                $0 start
+                ;;
+
+        status)
+                /usr/bin/pg_ctl status -D /var/pgsql/data
+                ;;
+
+        *)
+                echo "Usage: $0 {start|stop|restart|status}"
+                exit 1
+                ;;
+esac
+
+# End $rc_base/init.d/
+<command>EOF
+chmod 755 /etc/rc.d/init.d/postgresql</command></userinput></screen>
+
+<para>Create the symbolic links to this file in the relevant
+<filename class="directory">rc.d</filename> directory
+with the following commands:</para>
+
+<screen><userinput><command>cd /etc/rc.d/init.d &amp;&amp;
+ln -sf ../init.d/postgresql ../rc0.d/K26postgresql &amp;&amp;
+ln -sf ../init.d/postgresql ../rc1.d/K26postgresql &amp;&amp;
+ln -sf ../init.d/postgresql ../rc2.d/K26postgresql &amp;&amp;
+ln -sf ../init.d/postgresql ../rc3.d/S34postgresql &amp;&amp;
+ln -sf ../init.d/postgresql ../rc4.d/S34postgresql &amp;&amp;
+ln -sf ../init.d/postgresql ../rc5.d/S34postgresql &amp;&amp;
+ln -sf ../init.d/postgresql ../rc6.d/K26postgresql</command></userinput></screen>
+
+</sect3>
+
+</sect2>
Index: content/databases/postgresql/postgresql-desc.xml
===================================================================
--- content/databases/postgresql/postgresql-desc.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql/postgresql-desc.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,127 @@
+<sect2>
+<title>Contents</title>
+
+<para>The <application>Postgre<acronym>SQL</acronym></application> package contains
+<command>clusterdb</command>,
+<command>createdb</command>,
+<command>createlang</command>,
+<command>createuser</command>,
+<command>dropdb</command>,
+<command>droplang</command>,
+<command>dropuser</command>,
+<command>ecpg</command>,
+<command>initdb</command>,
+<command>initlocation</command>,
+<command>ipcclean</command>,
+<command>pg_config</command>,
+<command>pg_controldata</command>,
+<command>pg_ctl</command>,
+<command>pg_dump</command>,
+<command>pg_dumpall</command>,
+<command>pg_encoding</command>,
+<command>pg_id</command>,
+<command>pg_resetxlog</command>,
+<command>pg_restore</command>,
+<command>postgres</command>,
+<command>postmaster</command>,
+<command>psql</command>,
+<command>vacuumdb</command>,
+<filename class="libraryfile">libecpg</filename>,
+<filename class="libraryfile">libpq</filename> and various charset
+modules.</para>
+
+</sect2>
+
+<sect2><title>Description</title>
+
+<sect3><title>clusterdb</title>
+<para><command>clusterdb</command> is a utility for reclustering tables
+in a <application>Postgre<acronym>SQL</acronym></application>
+database.</para></sect3>
+
+<sect3><title>createdb</title>
+<para><command>createdb</command> creates a new
+<application>Postgre<acronym>SQL</acronym></application> database.</para></sect3>
+
+<sect3><title>createlang</title>
+<para><command>createlang</command> defines a new
+<application>Postgre<acronym>SQL</acronym></application> procedural
+language.</para></sect3>
+
+<sect3><title>createuser</title>
+<para><command>createuser</command> defines a new
+<application>Postgre<acronym>SQL</acronym></application> user account.</para></sect3>
+
+<sect3><title>dropdb</title>
+<para><command>dropdb</command> removes a
+<application>Postgre<acronym>SQL</acronym></application> database.</para></sect3>
+
+<sect3><title>droplang</title>
+<para><command>droplang</command> removes a
+<application>Postgre<acronym>SQL</acronym></application> procedural
+language.</para></sect3>
+
+<sect3><title>dropuser</title>
+<para><command>dropuser</command> removes a
+<application>Postgre<acronym>SQL</acronym></application> user account.</para></sect3>
+
+<sect3><title>ecpg</title>
+<para><command>ecpg</command> is the embedded <acronym>SQL</acronym> preprocessor.</para></sect3>
+
+<sect3><title>initdb</title>
+<para><command>initdb</command> create a new database cluster.</para></sect3>
+
+<sect3><title>initlocation</title>
+<para><command>initlocation</command> creates a secondary database storage
+area.</para></sect3>
+
+<sect3><title>ipcclean</title>
+<para><command>ipcclean</command> removes share memory and semaphores left over by an
+aborted database server.</para></sect3>
+
+<sect3><title>pg_config</title>
+<para><command>pg_config</command> retrieves
+<application>Postgre<acronym>SQL</acronym></application> version
+information.</para></sect3>
+
+<sect3><title>pg_controldata</title>
+<para><command>pg_controldata</command> returns information initialized during
+<command>initdb</command>, such as the catalog version and server
+locale.</para></sect3> 
+
+<sect3><title>pg_ctl</title>
+<para><command>pg_ctl</command> controls stopping and starting the database
+server.</para></sect3>
+
+<sect3><title>pg_dump</title>
+<para><command>pg_dump</command> dumps database data and metadata into scripts which are
+used to recreate the database.</para></sect3>
+
+<sect3><title>pg_dumpall</title>
+<para><command>pg_dumpall</command> recursively calls
+<command>pg_dump</command> for each database in a
+cluster.</para></sect3>
+
+<sect3><title>pg_resetxlog</title>
+<para><command>pg_resetxlog</command> clears the write-ahead log and optionally resets some
+fields in the <filename>pg_control</filename> file.</para></sect3>
+
+<sect3><title>pg_restore</title>
+<para><command>pg_restore</command> creates databases from dump files created by
+<command>pg_dump</command>.</para></sect3>
+
+<sect3><title>postgres</title>
+<para><command>postgres</command> is a single user database server, generally used for
+debugging.</para></sect3>
+
+<sect3><title>postmaster</title>
+<para><command>postmaster</command> is the multi-user database daemon.</para></sect3>
+
+<sect3><title>psql</title>
+<para><command>psql</command> is a console based database shell.</para></sect3>
+
+<sect3><title>vacuumdb</title>
+<para><command>vacuumdb</command> compacts databases and generates statistics for the
+query analyzer.</para></sect3>
+
+</sect2>
Index: content/databases/postgresql/postgresql-exp.xml
===================================================================
--- content/databases/postgresql/postgresql-exp.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql/postgresql-exp.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,18 @@
+<sect2>
+<title>Command explanations</title>
+
+<para><command>useradd -d /var/pgsql/data postgres</command>: Add an unprivileged user to run the database server. Running the
+server as root is dangerous, and moreover simply will not work.</para>
+
+<para><command>su - postgres -c '/usr/bin/initdb -D /var/pgsql/data'</command>: Initialize the database tablespace. This command may not be executed
+by root.</para>
+
+<para><command>su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > 
+/var/pgsql/data/logfile 2>&amp;1 &amp;'</command>: Start the database server. User postgres must execute this command as well.</para>
+
+<para><command>createdb test, create table t1 , insert into t1 values..., select *
+from t1</command>: Create a database, add a table to it, insert some rows into the table
+and select them to verify that the installation is working
+properly.</para>
+
+</sect2>
Index: content/databases/postgresql/postgresql-inst.xml
===================================================================
--- content/databases/postgresql/postgresql-inst.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql/postgresql-inst.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,37 @@
+<sect2>
+<title>Installation of <application>Postgre<acronym>SQL</acronym></application></title>
+
+<para>Install <application>Postgre<acronym>SQL</acronym></application> with the following commands: </para>
+
+<screen><userinput><command>./configure --prefix=/usr &amp;&amp;
+make &amp;&amp;
+make install</command></userinput></screen>
+
+<para>Initialize a database cluster with the following commands:</para>
+
+<screen><userinput><command>mkdir -p /var/pgsql/data &amp;&amp;
+useradd -d /var/pgsql/data postgres &amp;&amp;
+chown postgres /var/pgsql/data &amp;&amp;
+su - postgres -c '/usr/bin/initdb -D /var/pgsql/data'</command></userinput></screen>
+
+<para>Start the database server with the following command:</para>
+
+<screen><userinput><command>su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > \
+        /var/pgsql/data/logfile 2>&amp;1 &amp;'</command></userinput></screen>
+
+<para>Now we can create a database and verify the installation:</para>
+
+<screen><userinput><command>su - postgres -c '/usr/bin/createdb test'
+echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
+                | (su - postgres -c '/usr/bin/psql test ')
+		
+echo "insert into t1 values ('Billy', 'NewYork');" \
+                | (su - postgres -c '/usr/bin/psql test ')
+echo "insert into t1 values ('Evanidus', 'Quebec');" \
+	        | (su - postgres -c '/usr/bin/psql test ')
+echo "insert into t1 values ('Jesse', 'Ontario');" \
+                | (su - postgres -c '/usr/bin/psql test ')
+		
+echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</command></userinput></screen>
+
+</sect2>
Index: content/databases/postgresql/postgresql-intro.xml
===================================================================
--- content/databases/postgresql/postgresql-intro.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql/postgresql-intro.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,31 @@
+<sect2>
+<title>Introduction to <application>Postgre<acronym>SQL</acronym></application></title>
+
+<para><application>Postgre<acronym>SQL</acronym></application> is an advanced object-relational
+database management system (<acronym>ORDBMS</acronym>), derived from the 
+Berkeley Postgres database management system.</para>
+
+<sect3><title>Package information</title>
+<itemizedlist spacing='compact'>
+<listitem><para>Download (HTTP): <ulink url="&postgresql-download-http;"/></para></listitem>
+<listitem><para>Download (FTP): <ulink url="&postgresql-download-ftp;"/></para></listitem>
+<listitem><para>Download size: &postgresql-size;</para></listitem>
+<listitem><para>Estimated Disk space required: &postgresql-buildsize;</para></listitem>
+<listitem><para>Estimated build time: &postgresql-time;</para></listitem></itemizedlist>
+</sect3>
+
+<!--
+<note><para>The C++ and ODBC bindings have been removed from the main
+source distribution.  They can be found at the
+<application>Postgre<acronym>SQL</acronym></application> Projects Web
+Site at: <ulink url="http://gborg.postgresql.org" />.</para></note>
+-->
+
+<sect3><title><application>Postgre<acronym>SQL</acronym></application> dependencies</title>
+<sect4><title>Optional</title>
+<para><xref linkend="readline"/>, <xref linkend="Python"/>, <xref
+linkend="openssl"/> and <xref linkend="Linux_PAM"/>
+</para></sect4>
+</sect3>
+
+</sect2>
Index: content/databases/postgresql/postgresql.ent
===================================================================
--- content/databases/postgresql/postgresql.ent	(revision 458342f025e560780c0609bed031ed9c99f78c52)
+++ content/databases/postgresql/postgresql.ent	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -0,0 +1,12 @@
+<!ENTITY postgresql SYSTEM "../postgresql.xml">
+<!ENTITY postgresql-intro SYSTEM "postgresql-intro.xml">
+<!ENTITY postgresql-inst SYSTEM "postgresql-inst.xml">
+<!ENTITY postgresql-exp SYSTEM "postgresql-exp.xml">
+<!ENTITY postgresql-config SYSTEM "postgresql-config.xml">
+<!ENTITY postgresql-desc SYSTEM "postgresql-desc.xml">
+<!ENTITY postgresql-version "7.3.4">
+<!ENTITY postgresql-download-http "">
+<!ENTITY postgresql-download-ftp "ftp://ftp8.us.postgresql.org/pub/pgsql/source/v&postgresql-version;/postgresql-&postgresql-version;.tar.gz">
+<!ENTITY postgresql-size "11 MB">
+<!ENTITY postgresql-buildsize "86 MB">
+<!ENTITY postgresql-time "1.74 SBU">
Index: content/web/php/php-intro.xml
===================================================================
--- content/web/php/php-intro.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ content/web/php/php-intro.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -34,5 +34,5 @@
 <xref linkend="sendmail"/>, 
 <xref linkend="pcre"/>,
-<xref linkend="postgres"/>,
+<xref linkend="postgresql"/>,
 <xref linkend="readline"/>,
 <xref linkend="libtiff"/>,
Index: server/mail/courier/courier-intro.xml
===================================================================
--- server/mail/courier/courier-intro.xml	(revision d0beb4d64569c20f21704923837d71845bd54059)
+++ server/mail/courier/courier-intro.xml	(revision 458342f025e560780c0609bed031ed9c99f78c52)
@@ -26,5 +26,5 @@
 <para><xref linkend="gdbm"/> or <xref linkend="db"/></para></sect4>
 <sect4><title>Optional</title>
-<para><xref linkend="mysql"/> or <xref linkend="postgres"/>, 
+<para><xref linkend="mysql"/> or <xref linkend="postgresql"/>, 
 <xref linkend="Linux_PAM"/>, <xref linkend="openssl"/>, 
 <xref linkend="libfam"/>, <xref linkend="openldap"/>, expect, 
