gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 line
8.2KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>16.5. Post-Installation Setup</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="install-procedure.html" title="16.4. Installation Procedure" /><link rel="next" href="supported-platforms.html" title="16.6. Supported Platforms" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">16.5. Post-Installation Setup</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="install-procedure.html" title="16.4. Installation Procedure">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="installation.html" title="Chapter 16. Installation from Source Code">Up</a></td><th width="60%" align="center">Chapter 16. Installation from Source Code</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="supported-platforms.html" title="16.6. Supported Platforms">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="INSTALL-POST"><div class="titlepage"><div><div><h2 class="title" style="clear: both">16.5. Post-Installation Setup</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="install-post.html#id-1.6.3.9.2">16.5.1. Shared Libraries</a></span></dt><dt><span class="sect2"><a href="install-post.html#id-1.6.3.9.3">16.5.2. Environment Variables</a></span></dt></dl></div><div class="sect2" id="id-1.6.3.9.2"><div class="titlepage"><div><div><h3 class="title">16.5.1. Shared Libraries</h3></div></div></div><a id="id-1.6.3.9.2.2" class="indexterm"></a><p>
  3. On some systems with shared libraries
  4. you need to tell the system how to find the newly installed
  5. shared libraries. The systems on which this is
  6. <span class="emphasis"><em>not</em></span> necessary include
  7. <span class="systemitem">FreeBSD</span>,
  8. <span class="systemitem">HP-UX</span>,
  9. <span class="systemitem">Linux</span>,
  10. <span class="systemitem">NetBSD</span>, <span class="systemitem">OpenBSD</span>, and
  11. <span class="systemitem">Solaris</span>.
  12. </p><p>
  13. The method to set the shared library search path varies between
  14. platforms, but the most widely-used method is to set the
  15. environment variable <code class="envar">LD_LIBRARY_PATH</code> like so: In Bourne
  16. shells (<code class="command">sh</code>, <code class="command">ksh</code>, <code class="command">bash</code>, <code class="command">zsh</code>):
  17. </p><pre class="programlisting">
  18. LD_LIBRARY_PATH=/usr/local/pgsql/lib
  19. export LD_LIBRARY_PATH
  20. </pre><p>
  21. or in <code class="command">csh</code> or <code class="command">tcsh</code>:
  22. </p><pre class="programlisting">
  23. setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
  24. </pre><p>
  25. Replace <code class="literal">/usr/local/pgsql/lib</code> with whatever you set
  26. <code class="option"><code class="literal">--libdir</code></code> to in <a class="xref" href="install-procedure.html#CONFIGURE" title="Configuration">Step 1</a>.
  27. You should put these commands into a shell start-up file such as
  28. <code class="filename">/etc/profile</code> or <code class="filename">~/.bash_profile</code>. Some
  29. good information about the caveats associated with this method can
  30. be found at <a class="ulink" href="http://xahlee.info/UnixResource_dir/_/ldpath.html" target="_top">http://xahlee.info/UnixResource_dir/_/ldpath.html</a>.
  31. </p><p>
  32. On some systems it might be preferable to set the environment
  33. variable <code class="envar">LD_RUN_PATH</code> <span class="emphasis"><em>before</em></span>
  34. building.
  35. </p><p>
  36. On <span class="systemitem">Cygwin</span>, put the library
  37. directory in the <code class="envar">PATH</code> or move the
  38. <code class="filename">.dll</code> files into the <code class="filename">bin</code>
  39. directory.
  40. </p><p>
  41. If in doubt, refer to the manual pages of your system (perhaps
  42. <code class="command">ld.so</code> or <code class="command">rld</code>). If you later
  43. get a message like:
  44. </p><pre class="screen">
  45. psql: error in loading shared libraries
  46. libpq.so.2.1: cannot open shared object file: No such file or directory
  47. </pre><p>
  48. then this step was necessary. Simply take care of it then.
  49. </p><p>
  50. <a id="id-1.6.3.9.2.8.1" class="indexterm"></a>
  51. If you are on <span class="systemitem">Linux</span> and you have root
  52. access, you can run:
  53. </p><pre class="programlisting">
  54. /sbin/ldconfig /usr/local/pgsql/lib
  55. </pre><p>
  56. (or equivalent directory) after installation to enable the
  57. run-time linker to find the shared libraries faster. Refer to the
  58. manual page of <code class="command">ldconfig</code> for more information. On
  59. <span class="systemitem">FreeBSD</span>, <span class="systemitem">NetBSD</span>, and <span class="systemitem">OpenBSD</span> the command is:
  60. </p><pre class="programlisting">
  61. /sbin/ldconfig -m /usr/local/pgsql/lib
  62. </pre><p>
  63. instead. Other systems are not known to have an equivalent
  64. command.
  65. </p></div><div class="sect2" id="id-1.6.3.9.3"><div class="titlepage"><div><div><h3 class="title">16.5.2. Environment Variables</h3></div></div></div><a id="id-1.6.3.9.3.2" class="indexterm"></a><p>
  66. If you installed into <code class="filename">/usr/local/pgsql</code> or some other
  67. location that is not searched for programs by default, you should
  68. add <code class="filename">/usr/local/pgsql/bin</code> (or whatever you set
  69. <code class="option"><code class="literal">--bindir</code></code> to in <a class="xref" href="install-procedure.html#CONFIGURE" title="Configuration">Step 1</a>)
  70. into your <code class="envar">PATH</code>. Strictly speaking, this is not
  71. necessary, but it will make the use of <span class="productname">PostgreSQL</span>
  72. much more convenient.
  73. </p><p>
  74. To do this, add the following to your shell start-up file, such as
  75. <code class="filename">~/.bash_profile</code> (or <code class="filename">/etc/profile</code>, if you
  76. want it to affect all users):
  77. </p><pre class="programlisting">
  78. PATH=/usr/local/pgsql/bin:$PATH
  79. export PATH
  80. </pre><p>
  81. If you are using <code class="command">csh</code> or <code class="command">tcsh</code>, then use this command:
  82. </p><pre class="programlisting">
  83. set path = ( /usr/local/pgsql/bin $path )
  84. </pre><p>
  85. </p><p>
  86. <a id="id-1.6.3.9.3.5.1" class="indexterm"></a>
  87. To enable your system to find the <span class="application">man</span>
  88. documentation, you need to add lines like the following to a
  89. shell start-up file unless you installed into a location that is
  90. searched by default:
  91. </p><pre class="programlisting">
  92. MANPATH=/usr/local/pgsql/share/man:$MANPATH
  93. export MANPATH
  94. </pre><p>
  95. </p><p>
  96. The environment variables <code class="envar">PGHOST</code> and <code class="envar">PGPORT</code>
  97. specify to client applications the host and port of the database
  98. server, overriding the compiled-in defaults. If you are going to
  99. run client applications remotely then it is convenient if every
  100. user that plans to use the database sets <code class="envar">PGHOST</code>. This
  101. is not required, however; the settings can be communicated via command
  102. line options to most client programs.
  103. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install-procedure.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="installation.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="supported-platforms.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">16.4. Installation Procedure </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 16.6. Supported Platforms</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1