cvs commit: BLFS/BOOK/introduction/welcome changelog.xml credits.xml

larry at linuxfromscratch.org larry at linuxfromscratch.org
Sat Aug 24 07:44:25 PDT 2002


larry       02/08/24 07:44:25

  Modified:    BOOK/content content.ent
               BOOK/content/databases databases.xml
               BOOK/introduction/welcome changelog.xml credits.xml
  Added:       BOOK/content/databases postgres.xml
               BOOK/content/databases/postgres postgres-config.xml
                        postgres-desc.xml postgres-exp.xml
                        postgres-inst.xml postgres-intro.xml postgres.ent
  Log:
  added PostgreSQL
  
  Revision  Changes    Path
  1.2       +2 -0      BLFS/BOOK/content/content.ent
  
  Index: content.ent
  ===================================================================
  RCS file: /home/cvsroot/BLFS/BOOK/content/content.ent,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- content.ent	7 Jul 2002 20:28:47 -0000	1.1
  +++ content.ent	24 Aug 2002 14:44:24 -0000	1.2
  @@ -4,8 +4,10 @@
   <!ENTITY content-databases SYSTEM "databases/databases.xml">
   <!ENTITY % db SYSTEM "databases/db/db.ent">
   <!ENTITY % mysql SYSTEM "databases/mysql/mysql.ent">
  +<!ENTITY % postgres SYSTEM "databases/postgres/postgres.ent">
   %db;
   %mysql;
  +%postgres;
   
   <!-- Web server software -->
   <!ENTITY content-web SYSTEM "web/web.xml">
  
  
  
  1.2       +1 -0      BLFS/BOOK/content/databases/databases.xml
  
  Index: databases.xml
  ===================================================================
  RCS file: /home/cvsroot/BLFS/BOOK/content/databases/databases.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- databases.xml	7 Jul 2002 20:28:47 -0000	1.1
  +++ databases.xml	24 Aug 2002 14:44:24 -0000	1.2
  @@ -4,5 +4,6 @@
   
   &db;
   &mysql;
  +&postgres;
   
   </chapter>
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres.xml
  
  Index: postgres.xml
  ===================================================================
  <sect1 id="postgres" xreflabel="Postgres-&postgres-version;">
  <?dbhtml filename="postgres.html" dir="content"?>
  <title>PostgreSQL-&postgres-version;</title>
  
  &postgres-intro;
  &postgres-inst;
  &postgres-exp;
  &postgres-config;
  &postgres-desc;
  
  </sect1>
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres/postgres-config.xml
  
  Index: postgres-config.xml
  ===================================================================
  <sect2>
  <title>Configuring PostgreSQL</title>
  
  <sect3>
  <title>Config files</title>
  
  <para><userinput>
  $PGDATA/pg_ident.con, $PGDATA/pg_hba.conf, $PGDATA/postgresql.conf
  </userinput></para>
  
  <para>The PGDATA 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 PGDATA/ directory.  Details on the format of the files
  and the options that can be set in each can be found in :</para>
  <para>
  <ulink url="file:///usr/share/doc/postgresql/html/tutorial.html" />
  </para>
  
  <para>postgres init.d script</para>
  
  <para>Create the postgres, boot script with the following : </para>
  
  <screen><userinput>
  cat > /etc/rc.d/init.d/postgres << "EOF"</userinput>
  
  #!/bin/bash
  # Begin $rc_base/init.d/postgres
  
  # Based on sysklogd script from LFS-3.1 and earlier.
  # Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  
  source /etc/sysconfig/rc
  source $rc_functions
  
  case "$1" in
          start)
                  echo "Starting PostgreSQL daemon..."
                  su - postgres -c '/usr/bin/postmaster -D \
                      /var/pgsql/data > /var/pgsql/data/logfile 2>&1 &'
                  evaluate_retval
                  ;;
  
          stop)
                  echo "Stopping PostgreSQL daemon..."
                  killproc postmaster
                  ;;
  
          restart)
                  $0 stop
                  sleep 1
                  $0 start
                  ;;
  
          status)
                  statusproc /usr/sbin/postmaster
                  ;;
  
          *)
                  echo "Usage: $0 {start|stop|restart|status}"
                  exit 1
                  ;;
  esac
  
  # End $rc_base/init.d/
  <userinput>EOF
  chmod 755 /etc/rc.d/init.d/postgres</userinput></screen>
  
  <para>Create the symbolic links to this file in the relevant rc.d directory
  with the following commands:</para>
  
  <screen><userinput>
  cd /etc/rc.d/init.d &&
  ln -sf ../init.d/mysql ../rc0.d/K28postgres &&
  ln -sf ../init.d/postgres ../rc1.d/K28postgres &&
  ln -sf ../init.d/postgres ../rc2.d/K23postgres &&
  ln -sf ../init.d/postgres ../rc3.d/S35postgres &&
  ln -sf ../init.d/postgres ../rc4.d/S35postgres &&
  ln -sf ../init.d/postgres ../rc5.d/S35postgres &&
  ln -sf ../init.d/postgres ../rc6.d/K23postgres
  </userinput></screen>
  
  </sect3>
  
  </sect2>
  
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres/postgres-desc.xml
  
  Index: postgres-desc.xml
  ===================================================================
  <sect2>
  <title>Contents</title>
  
  <para>The PostgreSQL RDBMS contains
  <userinput>createdb</userinput>,
  <userinput>createlang</userinput>,
  <userinput>createuser</userinput>,
  <userinput>dropdb</userinput>,
  <userinput>droplang</userinput>,
  <userinput>dropuser</userinput>,
  <userinput>ecpg</userinput>,
  <userinput>initdb</userinput>,
  <userinput>initlocation</userinput>,
  <userinput>ipcclean</userinput>,
  <userinput>pg_config</userinput>,
  <userinput>pg_ctl</userinput>,
  <userinput>pg_dump</userinput>,
  <userinput>pg_dumpall</userinput>,
  <userinput>pg_passwd</userinput>,
  <userinput>pg_restore</userinput>,
  <userinput>pgaccess</userinput>,
  <userinput>pgtclsh</userinput>,
  <userinput>pgtksh</userinput>,
  <userinput>postgres</userinput>,
  <userinput>postmaster</userinput>,
  <userinput>psql</userinput> and
  <userinput>vacuumdb</userinput>.
  </para>
  
  </sect2>
  
  <sect2><title>Description</title>
  
  <sect3><title>createdb</title>
  <para>createdb creates a new PostgreSQL database.</para></sect3>
  
  <sect3><title>createlang</title>
  <para>createlang defines a new PostgreSQL procedural
  language.</para></sect3>
  
  <sect3><title>createuser</title>
  <para>createuser defines a new PostgreSQL user account.</para></sect3>
  
  <sect3><title>dropdb</title>
  <para>dropdb removes a PostgreSQL database.</para></sect3>
  
  <sect3><title>droplang</title>
  <para>droplang removes a PostgreSQL procedural
  language.</para></sect3>
  
  <sect3><title>dropuser</title>
  <para>dropuser removes a PostgreSQL user account.</para></sect3>
  
  <sect3><title>ecpg</title>
  <para>ecpg is the embedded SQL preprocessor.</para></sect3>
  
  <sect3><title>initdb</title>
  <para>initdb create a new database cluster.</para></sect3>
  
  <sect3><title>initlocation</title>
  <para>initlocation creates a secondary database storage
  area.</para></sect3>
  
  <sect3><title>ipcclean</title>
  <para>ipcclean removes share memory and semaphores left over by an
  aborted database server.</para></sect3>
  
  <sect3><title>pg_config</title>
  <para>pg_config retrieves PostgreSQL version
  information.</para></sect3>
  
  <sect3><title>pg_ctl</title>
  <para>pg_ctl controls stopping and starting the database
  server.</para></sect3>
  
  <sect3><title>pg_dump</title>
  <para>pg_dump dumps database data and metadata into scripts which are
  used to recreate the database.</para></sect3>
  
  <sect3><title>pg_dumpall</title>
  <para>pg_dumpall recursively calls pg_dump for each database in a
  cluster.</para></sect3>
  
  <sect3><title>pg_passwd</title>
  <para>pg_passwd is a secondary password file utility, for controlling
  access to databases.</para></sect3>
  <sect3><title>pg_restore</title>
  <para>pg_restore creates databases from dump files created by
  pg_dump.</para></sect3>
  
  <sect3><title>pgaccess</title>
  <para>pgaccess is a graphical client for PostgreSQL, written in
  Tk/tcl.</para></sect3>
  
  <sect3><title>pgtclsh</title>
  <para>pgtclsh is a tcl shell for PostgreSQL.</para></sect3>
  
  <sect3><title>pgtksh</title>
  <para>pgtksh is a wish style shell for PostgreSQLL.</para></sect3>
  
  <sect3><title>postgres</title>
  <para>postgres is a single user database server, generally used for
  debugging.</para></sect3>
  
  <sect3><title>postmaster</title>
  <para>postmaster is the multiuser database daemon.</para></sect3>
  
  <sect3><title>psql</title>
  <para>psql is a console based database shell.</para></sect3>
  
  <sect3><title>vacuumdb</title>
  <para>vacuumdb compacts databases and generates statistics for the
  query analyzer.</para></sect3>
  
  </sect2>
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres/postgres-exp.xml
  
  Index: postgres-exp.xml
  ===================================================================
  <sect2>
  <title>Command explanations</title>
  
  <para><userinput>useradd -d /var/pgsql/data postgres : </userinput>
  Add an unprivileged user to run the database server.  Running the
  server as root is dangerous, and moreover simply will not work.</para>
  
  <para><userinput>
  su - postgres -c '/usr/bin/initdb -D /var/pgsql/data' : </userinput>
  Initialize the database tablespace.  This command may not be executed
  by root.</para>
  
  <para><userinput>
  su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > \
          /var/pgsql/data/logfile 2>&1 &' : </userinput>
  Start the database server.  User postgres must execute this command as
  well.</para>
  
  <para><userinput>
  createdb test, create table t1 , insert into t1 values..., select *
  from t1 : </userinput>
  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>
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres/postgres-inst.xml
  
  Index: postgres-inst.xml
  ===================================================================
  <sect2>
  <title>Installation of PostgreSQL</title>
  
  <para>Install PostgreSQL with the following commands: </para>
  
  <para><screen><userinput>
  ./configure --prefix=/usr &&
  make &&
  make install &&
  </userinput></screen></para>
  
  <para>
  Initialize a database cluster with the following commands: </para>
  
  <para><screen><userinput>
  mkdir -p /var/pgsql/data &&
  useradd -d /var/pgsql/data postgres &&
  chown postgres /var/pgsql/data &&
  su - postgres -c '/usr/bin/initdb -D /var/pgsql/data'
  </userinput></screen></para>
  
  <para>Start the database server with the following command: </para>
  
  <para><screen><userinput>
  su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > \
          /var/pgsql/data/logfile 2>&1 &'
  </userinput></screen></para>
  
  <para>Now we can create a database and verify the installation: </para>
  
  <para><screen><userinput>
  su - postgres -c '/usr/bin/createdb test'
  echo "create table t1 ( name varchar(20), city 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', 'Ottowa');" \
                  | (su - postgres -c '/usr/bin/psql test ')
  		
  echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test ')
  						
  </userinput></screen></para>
  
  </sect2>
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres/postgres-intro.xml
  
  Index: postgres-intro.xml
  ===================================================================
  <sect2>
  <title>Introduction to PostgreSQL&postgres-version;</title>
  
  <screen>
  Download location (HTTP):     <ulink url="&postgres-download-http;" />
  
  Version used:                   &postgres-version;
  Package size:                   &postgres-size;
  Estimated Disk space required:  &postgres-buildsize;</screen>
  
  <para>The PostgreSQL package contains the PostgreSQL RDBMS, client
  utilites and language bindings.</para>
  
  </sect2>
  
  
  
  1.1                  BLFS/BOOK/content/databases/postgres/postgres.ent
  
  Index: postgres.ent
  ===================================================================
  <!ENTITY postgres SYSTEM "../postgres.xml">
  <!ENTITY postgres-intro SYSTEM "postgres-intro.xml">
  <!ENTITY postgres-inst SYSTEM "postgres-inst.xml">
  <!ENTITY postgres-exp SYSTEM "postgres-exp.xml">
  <!ENTITY postgres-config SYSTEM "postgres-config.xml">
  <!ENTITY postgres-desc SYSTEM "postgres-desc.xml">
  <!ENTITY postgres-version "7.2.2">
  <!ENTITY postgres-download-http
  "http://www.ca.postgresql.org/ftpsite/v7.2.2/postgresql-7.2.2.tar.gz">
  <!ENTITY postgres-size "9.2 MB">
  <!ENTITY postgres-buildsize "54 MB">
  
  
  
  1.82      +3 -0      BLFS/BOOK/introduction/welcome/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvsroot/BLFS/BOOK/introduction/welcome/changelog.xml,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- changelog.xml	24 Aug 2002 10:19:19 -0000	1.81
  +++ changelog.xml	24 Aug 2002 14:44:25 -0000	1.82
  @@ -10,6 +10,9 @@
   
   <itemizedlist>
   
  +<listitem><para>August 24th, 2002 [larry]: Content: Added
  +PostgreSQL.</para></listitem>
  +
   <listitem><para>August 24th, 2002 [larry]: pst: Added
   tex-1.0.</para></listitem>
   
  
  
  
  1.36      +1 -1      BLFS/BOOK/introduction/welcome/credits.xml
  
  Index: credits.xml
  ===================================================================
  RCS file: /home/cvsroot/BLFS/BOOK/introduction/welcome/credits.xml,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- credits.xml	24 Aug 2002 10:19:19 -0000	1.35
  +++ credits.xml	24 Aug 2002 14:44:25 -0000	1.36
  @@ -90,7 +90,7 @@
   <listitem><para>db and lcms: <emphasis>Jeremy Jones and Mark
   Hymers</emphasis></para></listitem>
   
  -<listitem><para>bind, emacs, leafnode, libfam, pine, qmail, Samba,
  +<listitem><para>bind, emacs, leafnode, libfam, pine, qmail, PostgreSQL, Samba,
   sendmail, slrn, tex and xinetd: <emphasis>Billy O'Connor</emphasis></para></listitem>
   
   <listitem><para>fetchmail and wvdial: <emphasis>Paul
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-book' in the subject header of the message



More information about the blfs-book mailing list