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

📄 install.sgml

📁 关系型数据库 Postgresql 6.5.2
💻 SGML
📖 第 1 页 / 共 3 页
字号:
<listitem><para>In FreeBSD 2.2-RELEASE edit /usr/local/etc/rc.d/pgsql.sh to          contain the following lines and make it chmod 755 and chown          root:bin.<programlisting>#!/bin/sh[ -x /usr/local/pgsql/bin/postmaster ] && {    su -l pgsql -c 'exec /usr/local/pgsql/bin/postmaster        -D/usr/local/pgsql/data        -S -o -F > /usr/local/pgsql/errlog' &    echo -n ' pgsql'}</programlisting>          You may put the line breaks as shown above.  The shell is smart          enough to keep parsing beyond end-of-line if there is an          expression unfinished.  The exec saves one layer of shell under          the postmaster process so the parent is init.</para></listitem><listitem><para>In RedHat Linux add a file <filename>/etc/rc.d/init.d/postgres.init</filename>which is based on the example in <filename>contrib/linux/</filename>.Then make a softlink to this file from <filename>/etc/rc.d/rc5.d/S98postgres.init</filename>.</para></listitem><listitem><para>In RedHat Linux edit file /etc/inittab to add the          following as a single line:<programlisting>pg:2345:respawn:/bin/su - postgres -c    "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data    &gt;&gt; /usr/local/pgsql/server.log 2&gt;&1 &lt;/dev/null"</programlisting>          (The author of this example says this example will revive the          postmaster if it dies, but he doesn't know if there are other side          effects.)</para></listitem></itemizedlist></Para></Step><Step Performance="required"><Para>     Run the regression tests.     The file <filename>/usr/src/pgsql/src/test/regress/README</filename> has detailed     instructions for running and interpreting the regression tests.     A short version follows here:</Para><substeps><Step Performance="required"><Para>    Type<ProgramListing>$ cd /usr/src/pgsql/src/test/regress$ gmake clean$ gmake all runtest</ProgramListing></Para><Para>     You do not need to type <command>gmake clean</command> if this is the first time you     are running the tests.</Para><Para>     You should get on the screen (and also written to file <filename>./regress.out</filename>)     a series of statements stating which tests passed and which tests     failed.  Please note that it can be normal for some tests to     "fail" on some platforms.  The script says a test has failed if there is any difference     at all between the actual output of the test and the expected output.     Thus, tests may "fail" due to minor differences in wording of error     messages, small differences in floating-point roundoff, etc, between     your system and the regression test reference platform.     "Failures" of this type do not indicate a problem with     <ProductName>Postgres</ProductName>.     The file <filename>./regression.diffs</filename> contains the textual differences between     the actual test output on your machine and the "expected" output     (which is simply what the reference system produced).  You should     carefully examine each difference listed to see whether it appears to     be a significant issue.</Para><para>For example,<itemizedlist><listitem><Para>     For a i686/Linux-ELF platform, no tests failed since this is the     v6.5.1 regression testing reference platform.</Para></listitem></itemizedlist></para><Para>     Even if a test result clearly indicates a real failure, it may be a     localized problem that will not affect you.  An example is that the     <type>int8</type> test will fail, producing obviously incorrect output, if your     machine and C compiler do not provide a 64-bit integer data type     (or if they do but configure didn't discover it).  This is not     something to worry about unless you need to store 64-bit integers.</Para><Para>     Conclusion?  If you do see failures, try to understand the nature of     the differences and then decide if those differences will affect your     intended use of <ProductName>Postgres</ProductName>.  The regression     tests are a helpful tool, but they may require some study to be useful.</Para><Para>     After running the regression tests, type<ProgramListing>$ destroydb regression$ cd /usr/src/pgsql/src/test/regress$ gmake clean</ProgramListing>    to recover the disk space used for the tests.  (You may want to save    the <filename>regression.diffs</filename> file in another place before doing this.)</Para></Step></substeps></step><Step Performance="required"><Para> If you haven't already done so, this would be a good time to modify      your computer to do regular maintainence.  The following should be      done at regular intervals:</para><procedure><title>Minimal Backup Procedure</title><step performance="required"><para>Run the <acronym>SQL</acronym> command <command>VACUUM</command>.  This will clean up your database.</para></step><step performance="required"><para>Back up your system.  (You should probably keep the last few           backups on hand.)  Preferably, no one else should be using the           system at the time.</para></step></procedure><para>      Ideally, the above tasks should be done by a shell script that is      run nightly or weekly by cron.  Look at the man page for <application>crontab</application>      for a starting point on how to do this.  (If you do it, please      e-mail us a copy of your shell script.  We would like to set up      our own systems to do this too.)</Para></Step><Step Performance="required"><Para> If you are upgrading an existing system then reinstall your old database.     Type<ProgramListing>$ cd$ psql -e template1 < db.out</ProgramListing>     If your pre-v6.2 database uses either path or polygon geometric data types,     then you will need to upgrade any columns containing those types. To     do so, type (from within psql)<ProgramListing>UPDATE <replaceable>FirstTable</replaceable> SET <replaceable>PathCol</replaceable> = UpgradePath(<replaceable>PathCol</replaceable>);UPDATE <replaceable>SecondTable</replaceable> SET <replaceable>PathCol</replaceable> = UpgradePath(<replaceable>PathCol</replaceable>);...VACUUM;</ProgramListing>     UpgradePath() checks to see that a path value is consistant with the     old syntax, and will not update a column which fails that examination.     UpgradePoly() cannot verify that a polygon is in fact from an old     syntax, but RevertPoly() is provided to reverse the effects of a     mis-applied upgrade.</Para></Step><Step Performance="required"><Para> If you are a new user, you may wish to play with <ProductName>Postgres</ProductName> as described     below.</Para></Step><Step Performance="required"><Para> Clean up after yourself.  Type<ProgramListing>$ rm -rf /usr/src/pgsql_6_5$ rm -rf /usr/local/pgsql_6_5# Also delete old database directory tree if it is not in#  /usr/local/pgsql_6_5/data$ rm ~/postgresql-v6.5.1.tar.gz</ProgramListing></Para></Step><Step Performance="required"><Para> You will probably want to print out the documentation. If you havea Postscript printer, or have your machine already set up to acceptPostscript files using a print filter, then to print the User's Guidesimply type<programlisting>$ cd /usr/local/pgsql/doc$ gunzip user.ps.tz | lpr</programlisting></para><para>  Here is how     you might do it if you have Ghostscript on your system and are     writing to a laserjet printer.<programlisting>$ alias gshp='gs -sDEVICE=laserjet -r300 -dNOPAUSE'$ export GS_LIB=/usr/share/ghostscript:/usr/share/ghostscript/fonts$ gunzip user.ps.gz$ gshp -sOUTPUTFILE=user.hp user.ps$ gzip user.ps$ lpr -l -s -r manpage.hp</programlisting></para></Step><Step Performance="required"><Para> The <ProductName>Postgres</ProductName> team wants to keep <ProductName>Postgres</ProductName> working on all of the     supported platforms.  We therefore ask you to let us know if you did     or did not get <ProductName>Postgres</ProductName> to work on you system.  Please send a     mail message to <ulink url="mailto:pgsql-ports@postgresql.org">pgsql-ports@postgresql.org</ulink> telling us the following:<itemizedlist><listitem><para>The version of <ProductName>Postgres</ProductName> (v6.5.1, 6.5, beta 990318, etc.).</para></listitem><listitem><para>Your operating system (i.e. RedHat v5.1 Linux v2.0.34).</para></listitem><listitem><para>Your hardware (SPARC, i486, etc.).</para></listitem><listitem><para>Did you compile, install and run the regression tests cleanly?         If not, what source code did you change (i.e. patches you         applied, changes you made, etc.), what tests failed, etc.         It is normal to get many warning when you compile.  You do         not need to report these.</para></listitem></itemizedlist></Para></Step><Step Performance="required"><Para> Now create, access and manipulate databases as desired.  Write client     programs to access the database server.  In other words, <emphasis>enjoy</emphasis>!</Para></Step></Procedure></sect1><Sect1><Title>Playing with <ProductName>Postgres</ProductName></Title><Para>After <ProductName>Postgres</ProductName> is installed, a database system is created, a postmasterdaemon is running, and the regression tests have passed, you'll want to see <ProductName>Postgres</ProductName> do something.  That's easy.  Invoke the interactive interfaceto <ProductName>Postgres</ProductName>, <Application>psql</Application>:<ProgramListing>% psql template1</ProgramListing>(psql has to open a particular database, but at this point the only onethat exists is the template1 database, which always exists.  We will connectto it only long enough to create another one and switch to it.)</Para><Para>The response from psql is:<ProgramListing>Welcome to the POSTGRESQL interactive sql monitor:  Please read the file COPYRIGHT for copyright terms of POSTGRESQL   type \? for help on slash commands   type \q to quit   type \g or terminate with semicolon to execute query You are currently connected to the database: template1template1=></ProgramListing></Para><Para>Create the database foo:<ProgramListing>template1=> create database foo;CREATEDB</ProgramListing>(Get in the habit of including those SQL semicolons.  Psql won't executeanything until it sees the semicolon or a "\g" and the semicolon is requiredto delimit multiple statements.)</Para><Para>Now connect to the new database:<ProgramListing>template1=> \c fooconnecting to new database: foo</ProgramListing>("slash" commands aren't SQL, so no semicolon.  Use \? to see all the slash commands.)</Para><Para>And create a table:<ProgramListing>foo=> create table bar (i int4, c char(16));CREATE</ProgramListing></Para><Para>Then inspect the new table:<ProgramListing>foo=> \d barTable    = bar+----------------------------------+----------------------------------+-------+|              Field               |              Type                | Length|+----------------------------------+----------------------------------+-------+| i                                | int4                             |     4 || c                                | (bp)char                         |    16 |+----------------------------------+----------------------------------+-------+</ProgramListing></Para><Para>And so on.  You get the idea.</Para></Sect1><Sect1><Title>The Next Step</Title><Para>Questions? Bugs? Feedback?First, read the files in directory <filename>/usr/src/pgsql/doc/</filename>.  The FAQ in this directory may be particularly useful.</Para><Para>If <ProductName>Postgres</ProductName> failed to compile on your computer then fill out the form in file <filename>/usr/src/pgsql/doc/bug.template</filename> and mail it to the location indicated at the top of the form.</Para><Para>Check on the web site at<ULink url="http://www.postgresql.org">http://www.postgresql.org</ULink>For more information on the various support mailing lists.</Para></Sect1>  <Sect1>   <Title>Porting Notes</Title>   <Para>    Check for any platform-specific FAQs in the <filename>doc/</filename> directory of    the source distribution.   </Para>  </sect1></Chapter><!-- Keep this comment at the end of the fileLocal variables:mode: sgmlsgml-omittag:nilsgml-shorttag:tsgml-minimize-attributes:nilsgml-always-quote-attributes:tsgml-indent-step:1sgml-indent-data:tsgml-parent-document:nilsgml-default-dtd-file:"./reference.ced"sgml-exposed-tags:nilsgml-local-catalogs:"/usr/lib/sgml/CATALOG"sgml-local-ecat-files:nilEnd:-->

⌨️ 快捷键说明

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