⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 installation.sgml

📁 PostgreSQL7.4.6 for Linux
💻 SGML
📖 第 1 页 / 共 5 页
字号:
    useful if you don't plan to keep the whole source tree around for    reference.  (If you do, you can just use the source's include    directory when building server-side software.)   </para>   <formalpara>    <title>Client-only installation:</title>    <para>     If you want to install only the client applications and     interface libraries, then you can use these commands:<screen><userinput>gmake -C src/bin install</><userinput>gmake -C src/include install</><userinput>gmake -C src/interfaces install</><userinput>gmake -C doc install</></screen>    </para>   </formalpara>  </step>  </procedure>  <formalpara>   <title>Uninstallation:</title>   <para>    To undo the installation use the command <command>gmake    uninstall</>. However, this will not remove any created directories.   </para>  </formalpara>  <formalpara>   <title>Cleaning:</title>   <para>    After the installation you can make room by removing the built    files from the source tree with the command <command>gmake    clean</>. This will preserve the files made by the <command>configure</command>    program, so that you can rebuild everything with <command>gmake</>    later on. To reset the source tree to the state in which it was    distributed, use <command>gmake distclean</>. If you are going to    build for several platforms from the same source tree you must do    this and re-configure for each build.   </para>  </formalpara>  <para>   If you perform a build and then discover that your <command>configure</>   options were wrong, or if you change anything that <command>configure</>   investigates (for example, software upgrades), then it's a good   idea to do <command>gmake distclean</> before reconfiguring and   rebuilding.  Without this, your changes in configuration choices   may not propagate everywhere they need to.  </para> </sect1> <sect1 id="install-post">  <title>Post-Installation Setup</title>  <sect2>   <title>Shared Libraries</title>   <indexterm>    <primary>shared library</primary>   </indexterm>   <para>    On some systems that have shared libraries (which most systems do)    you need to tell your system how to find the newly installed    shared libraries.  The systems on which this is    <emphasis>not</emphasis> necessary include <systemitem    class="osname">BSD/OS</>, <systemitem class="osname">FreeBSD</>,    <systemitem class="osname">HP-UX</>, <systemitem    class="osname">IRIX</>, <systemitem class="osname">Linux</>,    <systemitem class="osname">NetBSD</>, <systemitem    class="osname">OpenBSD</>, <systemitem class="osname">Tru64    UNIX</> (formerly <systemitem class="osname">Digital UNIX</>), and    <systemitem class="osname">Solaris</>.   </para>   <para>    The method to set the shared library search path varies between    platforms, but the most widely usable method is to set the    environment variable <envar>LD_LIBRARY_PATH</> like so: In Bourne    shells (<command>sh</>, <command>ksh</>, <command>bash</>, <command>zsh</>)<programlisting>LD_LIBRARY_PATH=/usr/local/pgsql/libexport LD_LIBRARY_PATH</programlisting>    or in <command>csh</> or <command>tcsh</><programlisting>setenv LD_LIBRARY_PATH /usr/local/pgsql/lib</programlisting>    Replace <literal>/usr/local/pgsql/lib</> with whatever you set    <option><literal>--libdir</></> to in <xref linkend="configure">.    You should put these commands into a shell start-up file such as    <filename>/etc/profile</> or <filename>~/.bash_profile</>.  Some    good information about the caveats associated with this method can    be found at <ulink    url="http://www.visi.com/~barr/ldpath.html"></ulink>.   </para>   <para>    On some systems it might be preferable to set the environment    variable <envar>LD_RUN_PATH</envar> <emphasis>before</emphasis>    building.   </para>   <para>    On <systemitem class="osname">Cygwin</systemitem>, put the library    directory in the <envar>PATH</envar> or move the    <filename>.dll</filename> files into the <filename>bin</filename>    directory.   </para>   <para>    If in doubt, refer to the manual pages of your system (perhaps    <command>ld.so</command> or <command>rld</command>). If you later    on get a message like<screen>psql: error in loading shared librarieslibpq.so.2.1: cannot open shared object file: No such file or directory</screen>    then this step was necessary.  Simply take care of it then.   </para>   <para>    <indexterm>     <primary>ldconfig</primary>    </indexterm>    If you are on <systemitem class="osname">BSD/OS</>, <systemitem    class="osname">Linux</>, or <systemitem class="osname">SunOS 4</>    and you have root access you can run<programlisting>/sbin/ldconfig /usr/local/pgsql/lib</programlisting>    (or equivalent directory) after installation to enable the    run-time linker to find the shared libraries faster.  Refer to the    manual page of <command>ldconfig</> for more information.  On    <systemitem class="osname">FreeBSD</>, <systemitem    class="osname">NetBSD</>, and <systemitem    class="osname">OpenBSD</> the command is<programlisting>/sbin/ldconfig -m /usr/local/pgsql/lib</programlisting>    instead.  Other systems are not known to have an equivalent    command.   </para>  </sect2>  <sect2>   <title>Environment Variables</title>   <indexterm>    <primary><envar>PATH</envar></primary>   </indexterm>   <para>    If you installed into <filename>/usr/local/pgsql</> or some other    location that is not searched for programs by default, you should    add <filename>/usr/local/pgsql/bin</> (or whatever you set    <option><literal>--bindir</></> to in <xref linkend="configure">)    into your <envar>PATH</>.  Strictly speaking, this is not    necessary, but it will make the use of <productname>PostgreSQL</>    much more convenient.   </para>   <para>    To do this, add the following to your shell start-up file, such as    <filename>~/.bash_profile</> (or <filename>/etc/profile</>, if you    want it to affect every user):<programlisting>PATH=/usr/local/pgsql/bin:$PATHexport PATH</programlisting>    If you are using <command>csh</> or <command>tcsh</>, then use this command:<programlisting>set path = ( /usr/local/pgsql/bin $path )</programlisting>   </para>   <para>    <indexterm>     <primary><envar>MANPATH</envar></primary>    </indexterm>    To enable your system to find the <application>man</>    documentation, you need to add lines like the following to a    shell start-up file unless you installed into a location that is    searched by default.<programlisting>MANPATH=/usr/local/pgsql/man:$MANPATHexport MANPATH</programlisting>   </para>   <para>    The environment variables <envar>PGHOST</> and <envar>PGPORT</>    specify to client applications the host and port of the database    server, overriding the compiled-in defaults. If you are going to    run client applications remotely then it is convenient if every    user that plans to use the database sets <envar>PGHOST</>.  This    is not required, however: the settings can be communicated via command    line options to most client programs.   </para>  </sect2> </sect1><![%standalone-include;[ <sect1 id="install-getting-started">  <title>Getting Started</title>  <para>   The following is a quick summary of how to get <productname>PostgreSQL</> up and   running once installed. The main documentation contains more information.  </para>  <procedure>   <step>    <para>     Create a user account for the <productname>PostgreSQL</>     server. This is the user the server will run as. For production     use you should create a separate, unprivileged account     (<quote>postgres</> is commonly used). If you do not have root     access or just want to play around, your own user account is     enough, but running the server as root is a security risk and     will not work.<screen><userinput>adduser postgres</></screen>    </para>   </step>   <step>    <para>     Create a database installation with the <command>initdb</>     command. To run <command>initdb</> you must be logged in to your     <productname>PostgreSQL</> server account. It will not work as     root.<screen>root# <userinput>mkdir /usr/local/pgsql/data</>root# <userinput>chown postgres /usr/local/pgsql/data</>root# <userinput>su - postgres</>postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</></screen>    </para>    <para>     The <option>-D</> option specifies the location where the data     will be stored. You can use any path you want, it does not have     to be under the installation directory. Just make sure that the     server account can write to the directory (or create it, if it     doesn't already exist) before starting <command>initdb</>, as     illustrated here.    </para>   </step>   <step>    <para>     The previous step should have told you how to start up the     database server. Do so now. The command should look something     like<programlisting>/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data</programlisting>     This will start the server in the foreground. To put the server     in the background use something like<programlisting>nohup /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data \    &lt;/dev/null &gt;&gt;server.log 2&gt;&amp;1 &lt;/dev/null &amp;</programlisting>    </para>    <para>     To stop a server running in the background you can type<programlisting>kill `cat /usr/local/pgsql/data/postmaster.pid`</programlisting>    </para>    <para>     In order to allow TCP/IP connections (rather than only Unix     domain socket ones) you need to pass the <option>-i</> option to     <filename>postmaster</>.    </para>   </step>   <step>    <para>     Create a database:<screen><userinput>createdb testdb</></screen>     Then enter<screen><userinput>psql testdb</></screen>     to connect to that database. At the prompt you can enter SQL     commands and start experimenting.    </para>   </step>  </procedure> </sect1> <sect1 id="install-whatnow">  <title>What Now?</title>  <para>   <itemizedlist>    <listitem>     <para>      The <productname>PostgreSQL</> distribution contains a      comprehensive documentation set, which you should read sometime.      After installation, the documentation can be accessed by      pointing your browser to      <filename>/usr/local/pgsql/doc/html/index.html</>, unless you      changed the installation directories.     </para>     <para>      The first few chapters of the main documentation are the Tutorial,      which should be your first reading if you are completely new to      <acronym>SQL</> databases.  If you are familiar with database      concepts then you want to proceed with part on server      administration, which contains information about how to set up      the database server, database users, and authentication.     </para>    </listitem>    <listitem>     <para>      Usually, you will want to modify your computer so that it will      automatically start the database server whenever it boots. Some      suggestions for this are in the documentation.     </para>    </listitem>    <listitem>     <para>      Run the regression tests against the installed server (using      <command>gmake installcheck</command>). If you didn't run the      tests before installation, you should definitely do it now. This      is also explained in the documentation.     </para>    </listitem>    <listitem>     <para>      By default, <productname>PostgreSQL</> is configured to run on      minimal hardware.  This allows it to start up with almost any      hardware configuration. The default configuration is, however,      not designed for optimum performance. To achieve optimum      performance, several server parameters must be adjusted, the two      most common being <varname>shared_buffers</varname> and      <varname> sort_mem</varname> mentioned in the documentation.      Other parameters mentioned in the documentation also affect      performance.     </para>    </listitem>   </itemizedlist>  </para> </sect1>]]> <sect1 id="supported-platforms">  <title>Supported Platforms</title>  <para>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -