Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/databases/postgresql.xml

    rbcdfc53 ra38fe9f  
    105105    <title>Installation of PostgreSQL</title>
    106106
     107    <para>
     108      For enhanced security, it is better to have a dedicated group and user
     109      for running the PostgreSQL server. First, issue as the
     110      <systemitem class="username">root</systemitem> user:
     111    </para>
     112
     113<screen role="root"><userinput>groupadd -g 41 postgres &amp;&amp;
     114useradd -c "PostgreSQL Server" -g postgres -d /srv/pgsql/data \
     115        -u 41 postgres</userinput></screen>
     116
    107117    <note>
     118      <para>
     119        There are several configuration items that add additional
     120        functionality with optional packages to
     121        <application>PostgreSQL</application>.  Use <command>./configure
     122        --help</command> to see a list.
     123      </para>
     124    </note>
     125
     126    <para>
     127      Install <application>PostgreSQL</application> with the
     128      following commands:
     129    </para>
     130
     131<screen><userinput>sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &amp;&amp;
     132
     133./configure --prefix=/usr          \
     134            --enable-thread-safety \
     135            --docdir=/usr/share/doc/postgresql-&postgresql-version; &amp;&amp;
     136make</userinput></screen>
     137
     138    <para>
     139      There are a number of programs in the
     140      <filename class="directory">contrib/</filename> directory. If you are
     141      going to run this installation as a server and wish to build some of
     142      them, enter <command>make -C contrib</command> or <command>make -C
     143      contrib/<replaceable>&lt;SUBDIR-NAME&gt;</replaceable></command> for
     144      each subdirectory.
     145    </para>
     146
     147    <para>
     148      Tests must be run as an unprivileged user because they need to start a
     149      temporary server and this is prevented as the root user. For the same
     150      reason, you need to stop all PostgreSQL servers if any are running. If a
     151      previous version of PostgreSQL is installed, it may be necessary to use
     152      <command>--disable-rpath</command> with <command>configure</command> to
     153      avoid failures, but <emphasis>installing the binaries created using this
     154      switch is not recommended</emphasis>. To test the results, issue:
     155      <command>make check</command>.
     156    </para>
     157
     158    <note>
     159      <para>Hold off from continuing in case you are building
     160      <application>PostgreSQL</application> to upgrade an existing
     161      installation. In case the major version of the new build is
     162      different to the existing one, its quite likely that the
     163      new software cannot act on the existing data files. In this case,
     164      the server will not start and the old binaries has been overwritten
     165      so you got stuck with an unusable database.</para>
     166
    108167      <para>
    109168        Before upgrading an existing installation of PostgreSQL check
     
    114173        <ulink url="https://www.postgresql.org/docs/current/upgrading.html"/>.
    115174      </para>
    116     </note>
    117 
    118     <para>
    119       For enhanced security, it is better to have a dedicated group and user
    120       for running the PostgreSQL server. First, issue as the
    121       <systemitem class="username">root</systemitem> user:
    122     </para>
    123 
    124 <screen role="root"><userinput>groupadd -g 41 postgres &amp;&amp;
    125 useradd -c "PostgreSQL Server" -g postgres -d /srv/pgsql/data \
    126         -u 41 postgres</userinput></screen>
    127 
    128     <note>
    129       <para>
    130         There are several configuration items that add additional
    131         functionality with optional packages to
    132         <application>PostgreSQL</application>.  Use <command>./configure
    133         --help</command> to see a list.
    134       </para>
    135     </note>
    136 
    137     <para>
    138       Install <application>PostgreSQL</application> with the
    139       following commands:
    140     </para>
    141 
    142 <screen><userinput>sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &amp;&amp;
    143 
    144 ./configure --prefix=/usr          \
    145             --enable-thread-safety \
    146             --docdir=/usr/share/doc/postgresql-&postgresql-version; &amp;&amp;
    147 make</userinput></screen>
    148 
    149     <para>
    150       There are a number of programs in the
    151       <filename class="directory">contrib/</filename> directory. If you are
    152       going to run this installation as a server and wish to build some of
    153       them, enter <command>make -C contrib</command> or <command>make -C
    154       contrib/<replaceable>&lt;SUBDIR-NAME&gt;</replaceable></command> for
    155       each subdirectory.
    156     </para>
    157 
    158     <para>
    159       Tests must be run as an unprivileged user because they need to start a
    160       temporary server and this is prevented as the root user. For the same
    161       reason, you need to stop all PostgreSQL servers if any are running. If a
    162       previous version of PostgreSQL is installed, it may be necessary to use
    163       <command>--disable-rpath</command> with <command>configure</command> to
    164       avoid failures, but <emphasis>installing the binaries created using this
    165       switch is not recommended</emphasis>. To test the results, issue:
    166       <command>make check</command>.
    167     </para>
    168 
    169     <note>
    170       <para>Hold off from continuing in case you are building
    171       <application>PostgreSQL</application> to upgrade an existing
    172       installation. In case the major version of the new build is
    173       different to the existing one, its quite likely that the
    174       new software cannot act on the existing data files. In this case,
    175       the server will not start and the old binaries has been overwritten
    176       so you got stuck with an unusable database.</para>
     175
    177176      <para>At this moment, you have both, the old and the new binaries
    178177      on disk. They can be used to perform an upgrade of your existing
Note: See TracChangeset for help on using the changeset viewer.