2 <Title>Installation</Title>
6 Complete installation instructions for
7 <ProductName>Postgres</ProductName> 6.5.3.
12 Before installing <ProductName>Postgres</ProductName>, you may wish to visit
13 <ULink url="http://www.postgresql.org">www.postgresql.org</ULink>
14 for up to date information, patches, etc.
18 These installation instructions assume:
20 <ItemizedList Mark="bullet" Spacing="compact">
23 Commands are Unix-compatible. See note below.
28 Defaults are used except where noted.
33 User <literal>postgres</literal> is the
34 <ProductName>Postgres</ProductName> superuser.
39 The source path is <filename>/usr/src/pgsql</filename> (other paths are possible).
44 The runtime path is <filename>/usr/local/pgsql</filename> (other paths are possible).
51 Commands were tested on RedHat Linux version 5.2 using the tcsh shell.
52 Except where noted, they will probably work on most systems. Commands
53 like <command>ps</command> and <command>tar</command> may vary wildly
54 between platforms on what options you should use.
55 <Emphasis>Use common sense</Emphasis> before typing in these commands.
59 Our Makefiles require GNU <Application>make</Application> (called
60 <Quote>gmake</Quote> in this document). They will <Emphasis>not</Emphasis>
61 work with non-GNU <Application>make</Application> programs. If you
62 have GNU <Application>make</Application> installed under the name
63 <Quote>make</Quote> instead of <Quote>gmake</Quote>, then you will use the
64 command <command>make</command> instead. That's OK, but
65 you need to have the GNU form of <Application>make</Application> to succeed with
70 <Title>Requirements to Run <ProductName>Postgres</ProductName></Title>
73 Up to date information on supported platforms is at
74 <ulink url="http://www.postgresql.org/docs/admin/install.htm">
75 http://www.postgresql.org/docs/admin/install.htm</ulink>.
77 In general, most Unix-compatible
78 platforms with modern libraries should be able to run
79 <ProductName>Postgres</ProductName>.
82 Although the minimum required memory for running <ProductName>Postgres</ProductName>
83 is as little as 8MB, there are noticable improvements in runtimes for the regression
84 tests when expanding memory up to 96MB on a relatively fast dual-processor system
86 The rule is you can never have too much memory.
89 Check that you have sufficient disk space. You will need about
90 30 Mbytes for <filename>/usr/src/pgsql</filename>,
91 about 5 Mbytes for <filename>/usr/local/pgsql</filename>
92 (excluding your database) and 1 Mbyte for an empty database.
93 The database will temporarily grow to about 20 Mbytes during the
94 regression tests. You will also need about 3 Mbytes for the
95 distribution tar file.
99 We therefore recommend that during installation and testing you
100 have well over 20 Mbytes free under <filename>/usr/local</filename> and another 25 Mbytes
101 free on the disk partition containing your database. Once you
102 delete the source files, tar file and regression database, you
103 will need 2 Mbytes for <filename>/usr/local/pgsql</filename>, 1 Mbyte for the empty
104 database, plus about five times the space you would require to
105 store your database data in a flat file.
109 To check for disk space, use
117 <Title>Installation Procedure</Title>
120 <Title><ProductName>Postgres</ProductName> Installation</Title>
123 For a fresh install or upgrading from previous releases of
124 <ProductName>Postgres</ProductName>:
127 <Step Performance="required">
129 Read any last minute information and platform specific porting
130 notes. There are some platform specific notes at the end of this
131 file for Ultrix4.x, Linux, BSD/OS and NeXT. There are other
132 files in directory <FileName>/usr/src/pgsql/postgresql-6.5.3/doc</FileName>, including files FAQ-Irix
133 and FAQ-Linux. Also look in directory
134 <ULink url="ftp://ftp.postgresql.org/pub">ftp://ftp.postgresql.org/pub</ULink>.
135 If there is a file called INSTALL in this directory then this
136 file will contain the latest installation information.
140 Please note that a "tested" platform in the list given earlier
141 simply means that someone went to the effort at some point of making
142 sure that a <ProductName>Postgres</ProductName> distribution would compile and run on this
143 platform without modifying the code. Since the current developers
144 will not have access to all of these platforms, some of them may not
145 compile cleanly and pass the regression tests in the current
146 release due to minor problems. Any such known problems and their
147 solutions will be posted in
148 <ULink url="ftp://ftp.postgresql.org/pub/INSTALL">ftp://ftp.postgresql.org/pub/INSTALL</ULink>.
152 <Step Performance="optional">
154 Create the <ProductName>Postgres</ProductName> superuser account
155 (<literal>postgres</literal> is commonly used) if it does not already exist.
158 The owner of the Postgres files can be any unprivileged user account.
159 It <emphasis>must not</emphasis> be <literal>root</literal>, <literal>bin</literal>,
160 or any other account with special access rights, as that would create a security risk.
164 <Step Performance="required">
166 Log in to the <ProductName>Postgres</ProductName> superuser account. Most of the
167 remaining steps in the installation will happen in this account.
170 <Step Performance="required">
173 <ulink url="ftp://ftp.postgresql.org/pub/postgresql-6.5.3.tar.gz">
174 <filename>ftp://ftp.postgresql.org/pub/postgresql-6.5.3.tar.gz</filename></ulink>
175 from the Internet. Store it in your home directory.
179 <Step Performance="required">
181 Some platforms use <application>flex</application>.
182 If your system uses <application>flex</application> then make sure
183 you have a good version. To check, type
191 If the <application>flex</application> command is not found then you probably do not need it.
192 If the version is 2.5.2 or 2.5.4 or greater then you are okay. If it
193 is 2.5.3 or before 2.5.2 then you will have to upgrade <application>flex</application>. You may
195 <ulink url="ftp://prep.ai.mit.edu/pub/gnu/flex-2.5.4.tar.gz">ftp://prep.ai.mit.edu/pub/gnu/flex-2.5.4.tar.gz</ulink>.
199 If you need <application>flex</application> and don't have it or have the wrong version, then
200 you will be told so when you attempt to compile the program. Feel
201 free to skip this step if you aren't sure you need it. If you do
202 need it then you will be told to install/upgrade <application>flex</application> when you try to
203 compile <productname>Postgres</productname>.
207 You may want to do the entire <application>flex</application> installation from
208 the root account, though that is not absolutely necessary.
209 Assuming that you want the installation to place files in the usual default
210 areas, type the following:
217 ftp> get flex-2.5.4.tar.gz
219 $ gunzip -c flex-2.5.4.tar.gz | tar xvf -
221 $ configure --prefix=/usr
224 # You must be root when typing the next line:
232 This will update files <filename>/usr/man/man1/flex.1</filename>,
233 <filename>/usr/bin/flex</filename>,
234 <filename>/usr/lib/libfl.a</filename>,
235 <filename>/usr/include/FlexLexer.h</filename> and will add a link
236 <filename>/usr/bin/flex++</filename> which points to flex.
240 <Step Performance="required">
242 If you are not upgrading an existing system then skip to
243 <xref linkend="newdirs">.
244 If you are upgrading from 6.5, you do not need to dump/reload or initdb.
245 Simply compile the source code, stop the postmaster, do a "make install", and
246 restart the postmaster.
248 If you are upgrading from 6.4.* or earlier, back up your database.
249 For alpha- and beta-level releases, the database format is liable
250 to change, often every few weeks, with no notice besides a quick comment
251 in the HACKERS mailing list. Full releases always require a dump/reload
252 from previous releases. It is therefore a bad idea to skip this
257 Do not use the <application>pg_dumpall</application>
258 script from 6.0 or everything
259 will be owned by the <ProductName>Postgres</ProductName> super user.
264 To dump your fairly recent post-6.0 database installation, type
267 $ pg_dumpall > db.out
271 To use the latest <application>pg_dumpall</application> script on your
272 existing older database before upgrading <productname>Postgres</productname>,
273 pull the most recent version of <application>pg_dumpall</application>
274 from the new distribution:
278 $ gunzip -c postgresql-6.5.3.tar.gz \
279 | tar xvf - postgresql-6.5.3/src/bin/pg_dump/pg_dumpall
280 $ chmod a+x postgresql-6.5.3/src/bin/pg_dump/pg_dumpall
281 $ postgresql-6.5.3/src/bin/pg_dump/pg_dumpall > db.out
282 $ rm -rf postgresql-6.5.3
287 If you wish to preserve object id's (oids), then use the -o
288 option when running <application>pg_dumpall</application>.
289 However, unless you have a
290 special reason for doing this (such as using OIDs as keys
291 in tables), don't do it.
295 If the <application>pg_dumpall</application> command
296 seems to take a long time and you think
297 it might have died, then, from another terminal, type
301 several times to see if the size of the file is growing.
305 Please note that if you are upgrading from a version prior to
306 <ProductName>Postgres95</ProductName> v1.09 then you must back up your database,
308 <ProductName>Postgres95</ProductName> v1.09, restore your database,
309 then back it up again.
310 You should also read the release notes which should cover any
311 release-specific issues.
316 You must make sure that your database is not updated in the middle of
317 your backup. If necessary, bring down postmaster, edit the permissions
318 in file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>
319 to allow only you on, then
320 bring <application>postmaster</application> back up.
326 <Step Performance="required">
328 If you are upgrading an existing system then kill the postmaster. Type
330 $ ps -ax | grep postmaster
333 This should list the process numbers for a number of processes. Type
334 the following line, with <replaceable>pid</replaceable>
335 replaced by the process id for process
336 <literal>postmaster</literal>.
337 (Do not use the id for process "grep postmaster".) Type
339 $ kill <replaceable>pid</replaceable>
341 to actually stop the process.
345 On systems which have <productname>Postgres</productname> started at boot time, there
346 is probably a startup file which will accomplish the same thing. For example, on my
347 Linux system I can type
349 $ /etc/rc.d/init.d/postgres.init stop
351 to halt <productname>Postgres</productname>.
357 <Step Performance="required">
359 If you are upgrading an existing system then move the old directories
360 out of the way. If you are short of disk space then you may have to
361 back up and delete the directories instead. If you do this, save the
362 old database in the <filename>/usr/local/pgsql/data</filename> directory tree. At a
363 minimum, save file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>.
379 If you are not using <filename>/usr/local/pgsql/data</filename>
380 as your data directory
381 (check to see if environment variable PGDATA is set to something
382 else) then you will also want to move this directory in the same
387 <Step Performance="required" id="newdirs">
389 Make new source and install directories. The actual paths can be
390 different for your installation but you must be consistent throughout this procedure.
394 There are two places in this installation procedure where you will have an opportunity
395 to specify installation locations for programs, libraries, documentation, and other files.
396 Usually it is sufficient to specify these at the <command>gmake install</command> stage
407 $ chown postgres:postgres pgsql
410 $ chown postgres:postgres pgsql
416 <Step Performance="required">
418 Unzip and untar the new source file. Type
421 $ gunzip -c ~/postgresql-6.5.3.tar.gz | tar xvf -
426 <Step Performance="required">
428 Configure the source code for your system. It is this step at which
429 you can specify your actual installation path for
430 the build process (see the --prefix option below). Type
432 $ cd /usr/src/pgsql/postgresql-6.5.3/src
433 $ ./configure [ <replaceable>options</replaceable> ]
439 <Step Performance="optional">
441 Among other chores, the configure script selects a system-specific
442 "template" file from the files provided in the template subdirectory.
443 If it cannot guess which one to use for your system, it will say so and
444 exit. In that case you'll need to figure out which one to use and run
445 configure again, this time giving the
446 <option>--with-template=TEMPLATE</option> option to
447 make the right file be chosen.
450 <title>Please Report Problems</title>
453 If your system is not automatically recognized by configure and you have to do this, please
455 <ulink url="mailto:scrappy@hub.org">scrappy@hub.org</ulink> with the output of the program
456 <application>./config.guess</application>. Indicate what the template file should be.
462 <Step Performance="optional">
464 Choose configuration options. Check <xref linkend="config" endterm="install-config">
465 for details. However, for a plain-vanilla first installation with no extra
466 options like multi-byte character support or locale collation support it may
467 be adequate to have chosen the installation areas and to run configure without
468 extra options specified.
470 The configure script accepts many additional options that you can use
471 if you don't like the default configuration. To see them all, type
475 Some of the more commonly used ones are:
477 --prefix=BASEDIR Selects a different base directory for the
478 installation of the <ProductName>Postgres</ProductName> configuration.
479 The default is /usr/local/pgsql.
480 --with-template=TEMPLATE
481 Use template file TEMPLATE - the template
482 files are assumed to be in the directory
483 src/template, so look there for proper values.
484 --with-tcl Build interface libraries and programs requiring
485 Tcl/Tk, including libpgtcl, pgtclsh, and pgtksh.
486 --with-perl Build the Perl interface library.
487 --with-odbc Build the ODBC driver package.
488 --enable-hba Enables Host Based Authentication (DEFAULT)
489 --disable-hba Disables Host Based Authentication
490 --enable-locale Enables USE_LOCALE
491 --enable-cassert Enables ASSERT_CHECKING
493 Use a specific C compiler that the configure
497 Use a specific C++ compiler that the configure
498 script cannot find, or exclude C++ compilation
499 altogether. (This only affects libpq++ at
504 <Step Performance="required">
506 Here is the configure script used on a Sparc Solaris 2.5 system
507 with <filename>/opt/postgres</filename> specified as
508 the installation base directory:
511 $ ./configure --prefix=/opt/postgres \
512 --with-template=sparc_solaris-gcc --with-pgport=5432 \
513 --enable-hba --disable-locale
518 Of course, you may type these three lines all
528 <Step Performance="required">
530 Install the <application>man</application> and
531 <acronym>HTML</acronym> documentation. Type
534 $ cd /usr/src/pgsql/postgresql-6.5.3/doc
539 The documentation is also available in Postscript format. Look for files
540 ending with <filename>.ps.gz</filename> in the same directory.
543 <Step Performance="required">
545 Compile the program. Type
548 $ cd /usr/src/pgsql/postgresql-6.5.3/src
549 $ gmake all > make.log 2>&1 &
555 The last line displayed will hopefully be
557 All of PostgreSQL is successfully made. Ready to install.
559 Remember, <Quote>gmake</Quote> may be called <Quote>make</Quote> on
562 At this point, or earlier
563 if you wish, type control-C to get out of tail. (If you have
564 problems later on you may wish to examine file make.log for
565 warning and error messages.)
569 You will probably find a number of warning
570 messages in make.log. Unless you have problems later on, these
571 messages may be safely ignored.
576 If the compiler fails with a message stating that
577 the <application>flex</application> command
578 cannot be found then install <application>flex</application> as described earlier.
580 change directory back to this directory, type
584 then recompile again.
588 Compiler options, such as optimization and debugging, may
589 be specified on the command line using the COPT variable.
592 $ gmake COPT="-g" all > make.log 2>&1 &
594 would invoke your compiler's <option>-g</option> option in all steps of the
595 build. See <filename>src/Makefile.global.in</filename> for further details.
599 <Step Performance="required">
601 Install the program. Type
603 $ cd /usr/src/pgsql/postgresql-6.5.3/src
604 $ gmake install > make.install.log 2>&1 &
605 $ tail -f make.install.log
610 The last line displayed will be
612 Thank you for choosing PostgreSQL, the most advanced open source
615 At this point, or earlier if you wish,
616 type control-C to get out of tail.
617 Remember, <Quote>gmake</Quote> may be called <Quote>make</Quote> on
622 <Step Performance="required">
624 If necessary, tell your system how to find the new shared libraries. You can
625 do <emphasis>one</emphasis> of the following, preferably the first:
628 <Step Performance="optional">
630 As root, edit file <filename>/etc/ld.so.conf</filename>. Add a line
632 <FileName>/usr/local/pgsql/lib</FileName>
634 to the file. Then run command <Command>/sbin/ldconfig</Command>.
638 <Step Performance="optional">
640 In a bash shell, type
642 export LD_LIBRARY_PATH=/usr/local/pgsql/lib
646 <Step Performance="optional">
650 setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
657 Please note that the above commands may vary wildly for different
658 operating systems. Check the platform specific notes, such as
659 those for Ultrix4.x or and for non-ELF Linux.
663 If, when you create the database, you get the message
665 pg_id: can't load library 'libpq.so'
667 then the above step was necessary. Simply
668 do this step, then try to create the database again.
672 <Step Performance="optional">
674 If you used the <option>--with-perl</option> option to configure, check
675 the install log to see whether the Perl module was actually installed.
676 If you've followed our advice to make the Postgres files be owned by
677 an unprivileged userid, then the Perl module won't have been installed,
678 for lack of write privileges on the Perl library directories. You can
679 complete its installation, either now or later, by becoming the user that
680 does own the Perl library (often root) (via <command>su</command>) and doing
682 $ cd /usr/src/pgsql/postgresql-6.5.3/src/interfaces/perl5
688 <Step Performance="required">
690 If it has not already been done, then prepare account <literal>postgres</literal>
691 for using <ProductName>Postgres</ProductName>.
692 Any account that will use <ProductName>Postgres</ProductName> must
693 be similarly prepared.
696 There are several ways to influence the runtime environment of the
697 <ProductName>Postgres</ProductName>
698 server. Refer to the <citetitle>Administrator's Guide</citetitle>
699 for more information.
702 The following instructions are for a
703 bash/sh shell. Adapt accordingly for other shells.
710 <Step Performance="required">
712 Add the following lines to your login environment:
714 shell, <filename>~/.bash_profile</filename>:
716 PATH=$PATH:/usr/local/pgsql/bin
717 MANPATH=$MANPATH:/usr/local/pgsql/man
718 PGLIB=/usr/local/pgsql/lib
719 PGDATA=/usr/local/pgsql/data
720 export PATH MANPATH PGLIB PGDATA
724 <Step Performance="required">
726 Several regression tests could fail if the user's locale collation
727 scheme is different from that of the standard <literal>C</literal> locale.
730 If you configure and compile <ProductName>Postgres</ProductName>
731 with <option>--enable-locale</option> then you should
732 set the locale environment to <quote><literal>C</literal></quote>
733 (or unset all <quote>LC_*</quote> variables)
734 by putting these additional lines to your login environment
735 before starting <application>postmaster</application>:
740 export LC_COLLATE LC_CTYPE
749 <Step Performance="required">
751 Make sure that you have defined these variables before continuing
752 with the remaining steps. The easiest way to do this is to type:
754 $ source ~/.bash_profile
762 <Step Performance="required">
764 Create the database installation from your <ProductName>Postgres</ProductName>
765 superuser account (typically account <literal>postgres</literal>).
767 <Emphasis>Do not do the following as root!</Emphasis>
768 This would be a major security hole. Type
775 <Step Performance="required">
777 Set up permissions to access the database system. Do this by editing
778 file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>. The instructions are
779 included in the file. (If your database is not located in the
780 default location, i.e. if <envar>PGDATA</envar> is set to point elsewhere, then the
781 location of this file will change accordingly.) This file should be
782 made read only again once you are finished.
784 If you are upgrading from 6.0 or later you can copy file <filename>pg_hba.conf</filename> from
785 your old database on top of the one in your new database, rather than
786 redoing the file from scratch.
790 <Step Performance="required">
792 Briefly test that the backend will start and run by running it from
797 <Step Performance="required">
799 Start the postmaster daemon running in the background by typing
802 $ nohup postmaster -i > pgserver.log 2>&1 &
807 <Step Performance="required">
809 Create a database by typing
815 <Step Performance="required">
817 Connect to the new database:
823 <Step Performance="required">
825 And run a sample query:
827 postgres=> SELECT datetime 'now';
831 <Step Performance="required">
833 Exit <application>psql</application>:
839 <Step Performance="required">
841 Remove the test database (unless you will want to use it later for other tests):
849 <Step Performance="required">
851 Run postmaster in the background from your <ProductName>Postgres</ProductName>
852 superuser account (typically account <literal>postgres</literal>).
853 <emphasis>Do not run <application>postmaster</application>
854 from the root account!</emphasis>
857 Usually, you will want to modify
858 your computer so that it will automatically start postmaster whenever
859 it boots. It is not required; the <ProductName>Postgres</ProductName>
861 be run successfully from non-privileged accounts without root intervention.
864 Here are some suggestions on how to do this, contributed by various
868 Whatever you do, postmaster must be run by
869 the <ProductName>Postgres</ProductName> superuser (<literal>postgres</literal>?)
870 <emphasis>and not by root</emphasis>.
871 This is why all of the examples below start by switching user
872 (su) to postgres. These commands also take into account the fact
873 that environment variables like PATH and PGDATA may not be set properly.
875 The examples are as follows. Use them with extreme caution.
877 <itemizedlist mark="bullet">
880 If you are installing from a non-privileged account and have no root access, then
881 start the <application>postmaster</application> and send it to the background:
885 $ nohup postmaster > regress.log 2>&1 &
891 Edit file rc.local on NetBSD or file rc2.d on SPARC Solaris
892 2.5.1 to contain the following single line:
894 su postgres -c "/usr/local/pgsql/bin/postmaster -S -D /usr/local/pgsql/data"
901 In FreeBSD 2.2-RELEASE edit /usr/local/etc/rc.d/pgsql.sh to
902 contain the following lines and make it chmod 755 and chown
907 [ -x /usr/local/pgsql/bin/postmaster ] && {
908 su -l pgsql -c 'exec /usr/local/pgsql/bin/postmaster
909 -D/usr/local/pgsql/data
910 -S -o -F > /usr/local/pgsql/errlog' &
915 You may put the line breaks as shown above. The shell is smart
916 enough to keep parsing beyond end-of-line if there is an
917 expression unfinished. The exec saves one layer of shell under
918 the postmaster process so the parent is init.
924 In RedHat Linux add a file <filename>/etc/rc.d/init.d/postgres.init</filename>
925 which is based on the example in <filename>contrib/linux/</filename>.
926 Then make a softlink to this file from
927 <filename>/etc/rc.d/rc5.d/S98postgres.init</filename>.
933 In RedHat Linux edit file /etc/inittab to add the
934 following as a single line:
937 pg:2345:respawn:/bin/su - postgres -c
938 "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data
939 >> /usr/local/pgsql/server.log 2>&1 </dev/null"
942 (The author of this example says this example will revive the
943 postmaster if it dies, but he doesn't know if there are other side
953 <Step Performance="required">
955 Run the regression tests.
956 The file <filename>/usr/src/pgsql/postgresql-6.5.3/src/test/regress/README</filename> has detailed
957 instructions for running and interpreting the regression tests.
958 A short version follows here:
963 <Step Performance="required">
967 $ cd /usr/src/pgsql/postgresql-6.5.3/src/test/regress
974 You do not need to type <command>gmake clean</command>
975 if this is the first time you
976 are running the tests.
980 You should get on the screen (and also written to file <filename>./regress.out</filename>)
981 a series of statements stating which tests passed and which tests
982 failed. Please note that it can be normal for some tests to
983 "fail" on some platforms.
984 The script says a test has failed if there is any difference
985 at all between the actual output of the test and the expected output.
986 Thus, tests may "fail" due to minor differences in wording of error
987 messages, small differences in floating-point roundoff, etc, between
988 your system and the regression test reference platform.
989 "Failures" of this type do not indicate a problem with
990 <ProductName>Postgres</ProductName>.
991 The file <filename>./regression.diffs</filename> contains the textual differences between
992 the actual test output on your machine and the "expected" output
993 (which is simply what the reference system produced). You should
994 carefully examine each difference listed to see whether it appears to
995 be a significant issue.
1004 For a i686/Linux-ELF platform, no tests failed since this is the
1005 6.5.3 regression testing reference platform.
1012 Even if a test result clearly indicates a real failure, it may be a
1013 localized problem that will not affect you. An example is that the
1014 <type>int8</type> test will fail, producing obviously incorrect output, if your
1015 machine and C compiler do not provide a 64-bit integer data type
1016 (or if they do but configure didn't discover it). This is not
1017 something to worry about unless you need to store 64-bit integers.
1021 Conclusion? If you do see failures, try to understand the nature of
1022 the differences and then decide if those differences will affect your
1023 intended use of <ProductName>Postgres</ProductName>. The regression
1024 tests are a helpful tool, but they may require some study to be useful.
1028 After running the regression tests, type
1031 $ destroydb regression
1032 $ cd /usr/src/pgsql/postgresql-6.5.3/src/test/regress
1036 to recover the disk space used for the tests. (You may want to save
1037 the <filename>regression.diffs</filename> file in another place before doing this.)
1043 <Step Performance="required">
1045 If you haven't already done so, this would be a good time to modify
1046 your computer to do regular maintainence. The following should be
1047 done at regular intervals:
1050 <title>Minimal Backup Procedure</title>
1052 <step performance="required">
1054 Run the <acronym>SQL</acronym> command <command>VACUUM</command>.
1055 This will clean up your database.
1058 <step performance="required">
1060 Back up your system. (You should probably keep the last few
1061 backups on hand.) Preferably, no one else should be using the
1068 Ideally, the above tasks should be done by a shell script that is
1069 run nightly or weekly by cron.
1070 Look at the man page for <application>crontab</application>
1071 for a starting point on how to do this. (If you do it, please
1072 e-mail us a copy of your shell script. We would like to set up
1073 our own systems to do this too.)
1077 <Step Performance="required">
1079 If you are upgrading an existing system then reinstall your old database.
1083 $ psql -e template1 < db.out
1086 If your pre-6.2 database uses either path or polygon geometric data types,
1087 then you will need to upgrade any columns containing those types. To
1088 do so, type (from within psql)
1090 UPDATE <replaceable>FirstTable</replaceable> SET <replaceable>PathCol</replaceable> = UpgradePath(<replaceable>PathCol</replaceable>);
1091 UPDATE <replaceable>SecondTable</replaceable> SET <replaceable>PathCol</replaceable> = UpgradePath(<replaceable>PathCol</replaceable>);
1096 UpgradePath() checks to see that a path value is consistant with the
1097 old syntax, and will not update a column which fails that examination.
1098 UpgradePoly() cannot verify that a polygon is in fact from an old
1099 syntax, but RevertPoly() is provided to reverse the effects of a
1100 mis-applied upgrade.
1104 <Step Performance="required">
1106 If you are a new user, you may wish to play with <ProductName>Postgres</ProductName> as described
1111 <Step Performance="required">
1113 Clean up after yourself. Type
1115 $ rm -rf /usr/src/pgsql
1116 $ rm -rf /usr/src/pgsql.old
1117 # Also delete the old database directory tree if desired.
1118 $ rm -rf /usr/local/pgsql.old
1123 <Step Performance="required">
1125 You will probably want to print out the documentation. If you have
1126 a Postscript printer, or have your machine already set up to accept
1127 Postscript files using a print filter, then to print the User's Guide
1131 $ cd /usr/local/pgsql/doc
1132 $ gunzip user.ps.tz | lpr
1137 you might do it if you have Ghostscript on your system and are
1138 writing to a laserjet printer.
1141 $ alias gshp='gs -sDEVICE=laserjet -r300 -dNOPAUSE'
1142 $ export GS_LIB=/usr/share/ghostscript:/usr/share/ghostscript/fonts
1144 $ gshp -sOUTPUTFILE=user.hp user.ps
1146 $ lpr -l -s -r manpage.hp
1151 <Step Performance="required">
1153 The <ProductName>Postgres</ProductName> team wants
1154 to keep <ProductName>Postgres</ProductName> working on all of the
1155 supported platforms. We therefore ask you to let us know if you did
1156 or did not get <ProductName>Postgres</ProductName> to work on you system.
1159 <ulink url="mailto:pgsql-ports@postgresql.org">pgsql-ports@postgresql.org</ulink>
1160 telling us the following:
1165 The version of <ProductName>Postgres</ProductName> (6.5.3, 6.5, beta 990318, etc.).
1171 Your operating system (i.e. RedHat v5.1 Linux v2.0.34).
1177 Your hardware (SPARC, i486, etc.).
1183 Did you compile, install and run the regression tests cleanly?
1184 If not, what source code did you change (i.e. patches you
1185 applied, changes you made, etc.), what tests failed, etc.
1186 It is normal to get many warning when you compile. You do
1187 not need to report these.
1196 <Step Performance="required">
1198 Now create, access and manipulate databases as desired. Write client
1199 programs to access the database server. In other words, <emphasis>enjoy</emphasis>!
1206 <Title>Playing with <ProductName>Postgres</ProductName></Title>
1209 After <ProductName>Postgres</ProductName> is installed, a database system is created, a postmaster
1210 daemon is running, and the regression tests have passed, you'll want to
1211 see <ProductName>Postgres</ProductName> do something. That's easy. Invoke the interactive interface
1212 to <ProductName>Postgres</ProductName>, <Application>psql</Application>:
1218 (psql has to open a particular database, but at this point the only one
1219 that exists is the template1 database, which always exists. We will connect
1220 to it only long enough to create another one and switch to it.)
1224 The response from psql is:
1227 Welcome to the POSTGRESQL interactive sql monitor:
1228 Please read the file COPYRIGHT for copyright terms of POSTGRESQL
1230 type \? for help on slash commands
1232 type \g or terminate with semicolon to execute query
1233 You are currently connected to the database: template1
1240 Create the database foo:
1243 template1=> create database foo;
1247 (Get in the habit of including those SQL semicolons. Psql won't execute
1248 anything until it sees the semicolon or a "\g" and the semicolon is required
1249 to delimit multiple statements.)
1253 Now connect to the new database:
1257 connecting to new database: foo
1260 ("slash" commands aren't SQL, so no semicolon. Use \? to see all the slash commands.)
1267 foo=> create table bar (i int4, c char(16));
1273 Then inspect the new table:
1279 +----------------------------------+----------------------------------+-------+
1280 | Field | Type | Length|
1281 +----------------------------------+----------------------------------+-------+
1283 | c | (bp)char | 16 |
1284 +----------------------------------+----------------------------------+-------+
1289 And so on. You get the idea.
1294 <Title>The Next Step</Title>
1297 Questions? Bugs? Feedback?
1298 First, read the files in directory <filename>/usr/src/pgsql/postgresql-6.5.3/doc/</filename>.
1299 The FAQ in this directory may be particularly useful.
1303 If <ProductName>Postgres</ProductName> failed to compile on your computer
1304 then fill out the form in file <filename>/usr/src/pgsql/postgresql-6.5.3/doc/bug.template</filename>
1305 and mail it to the location indicated at the top of the form.
1309 Check on the web site at
1310 <ULink url="http://www.postgresql.org">http://www.postgresql.org</ULink>
1311 For more information on the various support mailing lists.
1316 <Title>Porting Notes</Title>
1319 Check for any platform-specific FAQs in the <filename>doc/</filename> directory of
1320 the source distribution.
1326 <!-- Keep this comment at the end of the file
1331 sgml-minimize-attributes:nil
1332 sgml-always-quote-attributes:t
1335 sgml-parent-document:nil
1336 sgml-default-dtd-file:"./reference.ced"
1337 sgml-exposed-tags:nil
1338 sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
1339 sgml-local-ecat-files:nil