2 <Title>Installation</Title>
6 Complete installation instructions for
7 <ProductName>Postgres</ProductName> v6.4.
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 <ProductName>Postgres</ProductName> superuser.
38 The source path is <filename>/usr/src/pgsql</filename> (other paths are possible).
43 The runtime path is <filename>/usr/local/pgsql</filename> (other paths are possible).
49 Commands were tested on RedHat Linux version 4.2 using the tcsh shell.
50 Except where noted, they will probably work on most systems. Commands
51 like <command>ps</command> and <command>tar</command> may vary wildly
52 between platforms on what options you should use.
53 <Emphasis>Use common sense</Emphasis> before typing in these commands.
57 Our Makefiles require GNU <Application>make</Application> (called
58 <Quote>gmake</Quote> in this document). They will <Emphasis>not</Emphasis>
59 work with non-GNU <Application>make</Application> programs. If you
60 have GNU <Application>make</Application> installed under the name
61 <Quote>make</Quote> instead of <Quote>gmake</Quote>, then you will use the
62 command <command>make</command> instead. That's OK, but
63 you need to have the GNU form of <Application>make</Application> to succeed with
68 <Title>Requirements to Run <ProductName>Postgres</ProductName></Title>
71 Up to date information on supported platforms is at
72 <ulink url="http://www.postgresql.org/docs/admin/install.htm">
73 http://www.postgresql.org/docs/admin/install.htm</ulink>.
75 In general, most Unix-compatible
76 platforms with modern libraries should be able to run <ProductName>Postgres</ProductName>.
79 Although the minimum required memory for running <ProductName>Postgres</ProductName>
80 is as little as 8MB, there are noticable improvements in runtimes for the regression
81 tests when expanding memory up to 96MB on a relatively fast dual-processor system
83 The rule is you can never have too much memory.
86 Check that you have sufficient disk space. You will need about
87 30 Mbytes for <filename>/usr/src/pgsql</filename>,
88 about 5 Mbytes for <filename>/usr/local/pgsql</filename>
89 (excluding your database) and 1 Mbyte for an empty database.
90 The database will temporarily grow to about 20 Mbytes during the
91 regression tests. You will also need about 3 Mbytes for the
92 distribution tar file.
96 We therefore recommend that during installation and testing you
97 have well over 20 Mbytes free under <filename>/usr/local</filename> and another 25 Mbytes
98 free on the disk partition containing your database. Once you
99 delete the source files, tar file and regression database, you
100 will need 2 Mbytes for <filename>/usr/local/pgsql</filename>, 1 Mbyte for the empty
101 database, plus about five times the space you would require to
102 store your database data in a flat file.
106 To check for disk space, use
114 <Title>Installation Procedure</Title>
117 <Title><ProductName>Postgres</ProductName> Installation</Title>
120 For a fresh install or upgrading from previous releases of
121 <ProductName>Postgres</ProductName>:
124 <Step Performance="required">
126 Read any last minute information and platform specific porting
127 notes. There are some platform specific notes at the end of this
128 file for Ultrix4.x, Linux, BSD/OS and NeXT. There are other
129 files in directory <FileName>/usr/src/pgsql/doc</FileName>, including files FAQ-Irix
130 and FAQ-Linux. Also look in directory
131 <ULink url="ftp://ftp.postgresql.org/pub">ftp://ftp.postgresql.org/pub</ULink>.
132 If there is a file called INSTALL in this directory then this
133 file will contain the latest installation information.
137 Please note that a "tested" platform in the list given earlier
138 simply means that someone went to the effort at some point of making
139 sure that a <ProductName>Postgres</ProductName> distribution would compile and run on this
140 platform without modifying the code. Since the current developers
141 will not have access to all of these platforms, some of them may not
142 compile cleanly and pass the regression tests in the current
143 release due to minor problems. Any such known problems and their
144 solutions will be posted in
145 <ULink url="ftp://ftp.postgresql.org/pub/INSTALL">ftp://ftp.postgresql.org/pub/INSTALL</ULink>.
149 <Step Performance="optional">
151 Create the <ProductName>Postgres</ProductName> superuser account
152 (<literal>postgres</literal> is commonly used) if it does not already exist.
155 The owner of the Postgres files can be any unprivileged user account.
156 It <emphasis>must not</emphasis> be <literal>root</literal>, <literal>bin</literal>,
157 or any other account with special access rights, as that would create a security risk.
161 <Step Performance="required">
163 Log in to the <ProductName>Postgres</ProductName> superuser account. Most of the
164 remaining steps in the installation will happen in this account.
167 <Step Performance="required">
170 <ulink url="ftp://ftp.postgresql.org/pub/postgresql-v6.4.tar.gz">
171 <filename>ftp://ftp.postgresql.org/pub/postgresql-v6.4.tar.gz</filename></ulink>
172 from the Internet. Store it in your home directory.
176 <Step Performance="required">
178 Some platforms use <application>flex</application>.
179 If your system uses <application>flex</application> then make sure
180 you have a good version. To check, type
188 If the <application>flex</application> command is not found then you probably do not need it.
189 If the version is 2.5.2 or 2.5.4 or greater then you are okay. If it
190 is 2.5.3 or before 2.5.2 then you will have to upgrade <application>flex</application>. You may
192 <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>.
196 If you need <application>flex</application> and don't have it or have the wrong version, then
197 you will be told so when you attempt to compile the program. Feel
198 free to skip this step if you aren't sure you need it. If you do
199 need it then you will be told to install/upgrade <application>flex</application> when you try to
200 compile <productname>Postgres</productname>.
204 You may want to do the entire <application>flex</application> installation from
205 the root account, though that is not absolutely necessary.
206 Assuming that you want the installation to place files in the usual default
207 areas, type the following:
214 ftp> get flex-2.5.4.tar.gz
216 $ gunzip -c flex-2.5.4.tar.gz | tar xvf -
218 $ configure --prefix=/usr
221 # You must be root when typing the next line:
229 This will update files <filename>/usr/man/man1/flex.1</filename>,
230 <filename>/usr/bin/flex</filename>,
231 <filename>/usr/lib/libfl.a</filename>,
232 <filename>/usr/include/FlexLexer.h</filename> and will add a link
233 <filename>/usr/bin/flex++</filename> which points to flex.
237 <Step Performance="required">
239 If you are not upgrading an existing system then skip to
240 <xref linkend="newdirs">.
241 If you are upgrading an existing system then back up your database.
242 For alpha- and beta-level releases, the database format is liable
243 to change, often every few weeks, with no notice besides a quick comment
244 in the HACKERS mailing list. Full releases always require a dump/reload
245 from previous releases. It is therefore a bad idea to skip this
250 Do not use the <application>pg_dumpall</application>
251 script from v6.0 or everything
252 will be owned by the <ProductName>Postgres</ProductName> super user.
257 To dump your fairly recent post-v6.0 database installation, type
260 $ pg_dumpall -z > db.out
264 To use the latest <application>pg_dumpall</application> script on your
265 existing older database before upgrading <productname>Postgres</productname>,
266 pull the most recent version of <application>pg_dumpall</application>
267 from the new distribution:
271 $ gunzip -c postgresql-v6.4.tar.gz \
272 | tar xvf - src/bin/pg_dump/pg_dumpall
273 $ chmod a+x src/bin/pg_dump/pg_dumpall
274 $ src/bin/pg_dump/pg_dumpall -z > db.out
280 If you wish to preserve object id's (oids), then use the -o
281 option when running <application>pg_dumpall</application>.
282 However, unless you have a
283 special reason for doing this (such as using OIDs as keys
284 in tables), don't do it.
288 If the <application>pg_dumpall</application> command
289 seems to take a long time and you think
290 it might have died, then, from another terminal, type
294 several times to see if the size of the file is growing.
298 Please note that if you are upgrading from a version prior to
299 <ProductName>Postgres95</ProductName> v1.09 then you must back up your database,
301 <ProductName>Postgres95</ProductName> v1.09, restore your database,
302 then back it up again.
303 You should also read the release notes which should cover any
304 release-specific issues.
309 You must make sure that your database is not updated in the middle of
310 your backup. If necessary, bring down postmaster, edit the permissions
311 in file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>
312 to allow only you on, then
313 bring <application>postmaster</application> back up.
319 <Step Performance="required">
321 If you are upgrading an existing system then kill the postmaster. Type
323 $ ps -ax | grep postmaster
326 This should list the process numbers for a number of processes. Type
327 the following line, with <replaceable>pid</replaceable>
328 replaced by the process id for process
329 <literal>postmaster</literal>.
330 (Do not use the id for process "grep postmaster".) Type
332 $ kill <replaceable>pid</replaceable>
334 to actually stop the process.
338 On systems which have <productname>Postgres</productname> started at boot time, there
339 is probably a startup file which will accomplish the same thing. For example, on my
340 Linux system I can type
342 $ /etc/rc.d/init.d/postgres.init stop
344 to halt <productname>Postgres</productname>.
350 <Step Performance="required">
352 If you are upgrading an existing system then move the old directories
353 out of the way. If you are short of disk space then you may have to
354 back up and delete the directories instead. If you do this, save the
355 old database in the <filename>/usr/local/pgsql/data</filename> directory tree. At a
356 minimum, save file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>.
372 If you are not using <filename>/usr/local/pgsql/data</filename>
373 as your data directory
374 (check to see if environment variable PGDATA is set to something
375 else) then you will also want to move this directory in the same
380 <Step Performance="required" id="newdirs">
382 Make new source and install directories. The actual paths can be
383 different for your installation but you must be consistent throughout this procedure.
387 There are two places in this installation procedure where you will have an opportunity
388 to specify installation locations for programs, libraries, documentation, and other files.
389 Usually it is sufficient to specify these at the <command>make install</command> stage
400 $ chown postgres:postgres pgsql
403 $ chown postgres:postgres pgsql
409 <Step Performance="required">
411 Unzip and untar the new source file. Type
414 $ gunzip -c ~/postgresql-v6.4.tar.gz | tar xvf -
419 <Step Performance="required">
421 Configure the source code for your system. It is this step at which
422 you can specify your actual installation path for
423 the build process (see the --prefix option below). Type
425 $ cd /usr/src/pgsql/src
426 $ ./configure [ <replaceable>options</replaceable> ]
432 <Step Performance="optional">
434 Among other chores, the configure script selects a system-specific
435 "template" file from the files provided in the template subdirectory.
436 If it cannot guess which one to use for your system, it will say so and
437 exit. In that case you'll need to figure out which one to use and run
438 configure again, this time giving the
439 <option>--with-template=TEMPLATE</option> option to
440 make the right file be chosen.
443 <title>Please Report Problems</title>
446 If your system is not automatically recognized by configure and you have to do this, please
448 <ulink url="mailto:scrappy@hub.org">scrappy@hub.org</ulink> with the output of the program
449 <application>./config.guess</application>. Indicate what the template file should be.
455 <Step Performance="optional">
457 Choose configuration options. Check <xref linkend="config" endterm="install-config">
458 for details. However, for a plain-vanilla first installation with no extra
459 options like multi-byte character support or locale collation support it may
460 be adequate to have chosen the installation areas and to run configure without
461 extra options specified.
463 The configure script accepts many additional options that you can use
464 if you don't like the default configuration. To see them all, type
468 Some of the more commonly used ones are:
470 --prefix=BASEDIR Selects a different base directory for the
471 installation of the <ProductName>Postgres</ProductName> configuration.
472 The default is /usr/local/pgsql.
473 --with-template=TEMPLATE
474 Use template file TEMPLATE - the template
475 files are assumed to be in the directory
476 src/template, so look there for proper values.
477 --with-tcl Build interface libraries and programs requiring
478 Tcl/Tk, including libpgtcl, pgtclsh, and pgtksh.
479 --with-perl Build the Perl interface library.
480 --with-odbc Build the ODBC driver package.
481 --enable-hba Enables Host Based Authentication (DEFAULT)
482 --disable-hba Disables Host Based Authentication
483 --enable-locale Enables USE_LOCALE
484 --enable-cassert Enables ASSERT_CHECKING
486 Use a specific C compiler that the configure
490 Use a specific C++ compiler that the configure
491 script cannot find, or exclude C++ compilation
492 altogether. (This only affects libpq++ at
497 <Step Performance="required">
499 Here is the configure script used on a Sparc Solaris 2.5 system
500 with <filename>/opt/postgres</filename> specified as
501 the installation base directory:
504 $ ./configure --prefix=/opt/postgres \
505 --with-template=sparc_solaris-gcc --with-pgport=5432 \
506 --enable-hba --disable-locale
511 Of course, you may type these three lines all
521 <Step Performance="required">
523 Install the <application>man</application> and
524 <acronym>HTML</acronym> documentation. Type
527 $ cd /usr/src/pgsql/doc
532 The documentation is also available in Postscript format. Look for files
533 ending with <filename>.ps.gz</filename> in the same directory.
536 <Step Performance="required">
538 Compile the program. Type
541 $ cd /usr/src/pgsql/src
542 $ gmake all >& make.log &
548 The last line displayed will hopefully be
550 All of PostgreSQL is successfully made. Ready to install.
553 At this point, or earlier
554 if you wish, type control-C to get out of tail. (If you have
555 problems later on you may wish to examine file make.log for
556 warning and error messages.)
560 You will probably find a number of warning
561 messages in make.log. Unless you have problems later on, these
562 messages may be safely ignored.
567 If the compiler fails with a message stating that
568 the <application>flex</application> command
569 cannot be found then install <application>flex</application> as described earlier.
571 change directory back to this directory, type
575 then recompile again.
579 Compiler options, such as optimization and debugging, may
580 be specified on the command line using the COPT variable.
583 $ gmake COPT="-g" all >& make.log &
585 would invoke your compiler's <option>-g</option> option in all steps of the
586 build. See <filename>src/Makefile.global.in</filename> for further details.
590 <Step Performance="required">
592 Install the program. Type
594 $ cd /usr/src/pgsql/src
595 $ gmake install >& make.install.log &
596 $ tail -f make.install.log
601 The last line displayed will be
603 gmake[1]: Leaving directory `/usr/src/pgsql/src/man'
605 At this point, or earlier if you wish,
606 type control-C to get out of tail.
610 <Step Performance="required">
612 If necessary, tell your system how to find the new shared libraries. You can
613 do <emphasis>one</emphasis> of the following, preferably the first:
616 <Step Performance="optional">
618 As root, edit file <filename>/etc/ld.so.conf</filename>. Add a line
620 <FileName>/usr/local/pgsql/lib</FileName>
622 to the file. Then run command <Command>/sbin/ldconfig</Command>.
626 <Step Performance="optional">
628 In a bash shell, type
630 export LD_LIBRARY_PATH=/usr/local/pgsql/lib
634 <Step Performance="optional">
638 setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
645 Please note that the above commands may vary wildly for different
646 operating systems. Check the platform specific notes, such as
647 those for Ultrix4.x or and for non-ELF Linux.
651 If, when you create the database, you get the message
653 pg_id: can't load library 'libpq.so'
655 then the above step was necessary. Simply
656 do this step, then try to create the database again.
660 <Step Performance="optional">
662 If you used the <option>--with-perl</option> option to configure, check
663 the install log to see whether the Perl module was actually installed.
664 If you've followed our advice to make the Postgres files be owned by
665 an unprivileged userid, then the Perl module won't have been installed,
666 for lack of write privileges on the Perl library directories. You can
667 complete its installation, either now or later, by becoming the user that
668 does own the Perl library (often root) (via <command>su</command>) and doing
670 $ cd /usr/src/pgsql/src/interfaces/perl5
676 <Step Performance="required">
678 If it has not already been done, then prepare account <literal>postgres</literal>
679 for using <ProductName>Postgres</ProductName>.
680 Any account that will use <ProductName>Postgres</ProductName> must
681 be similarly prepared.
684 There are several ways to influence the runtime environment of the
685 <ProductName>Postgres</ProductName>
686 server. Refer to the <citetitle>Administrator's Guide</citetitle>
687 for more information.
690 The following instructions are for a
691 bash/sh shell. Adapt accordingly for other shells.
698 <Step Performance="required">
700 Add the following lines to your login environment:
702 shell, <filename>~/.bash_profile</filename>:
704 PATH=$PATH:/usr/local/pgsql/bin
705 MANPATH=$MANPATH:/usr/local/pgsql/man
706 PGLIB=/usr/local/pgsql/lib
707 PGDATA=/usr/local/pgsql/data
708 export PATH MANPATH PGLIB PGDATA
712 <Step Performance="required">
714 Several regression tests could fail if the user's locale collation
715 scheme is different from that of standard C locale.
718 If you configure and compile <ProductName>Postgres</ProductName>
719 with the <option>--enable-locale</option> option then
720 set locale environment to C (or unset all LC_* variables)
721 by putting these additional lines to your login environment
722 before starting postmaster:
727 export LC_COLLATE LC_CTYPE LC_COLLATE
736 <Step Performance="required">
738 Make sure that you have defined these variables before continuing
739 with the remaining steps. The easiest way to do this is to type:
741 $ source ~/.bash_profile
749 <Step Performance="required">
751 Create the database installation from your <ProductName>Postgres</ProductName>
752 superuser account (typically account <literal>postgres</literal>).
754 <Emphasis>Do not do the following as root!</Emphasis>
755 This would be a major security hole. Type
762 <Step Performance="required">
764 Set up permissions to access the database system. Do this by editing
765 file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>. The instructions are
766 included in the file. (If your database is not located in the
767 default location, i.e. if <envar>PGDATA</envar> is set to point elsewhere, then the
768 location of this file will change accordingly.) This file should be
769 made read only again once you are finished.
771 If you are upgrading from v6.0 or later you can copy file <filename>pg_hba.conf</filename> from
772 your old database on top of the one in your new database, rather than
773 redoing the file from scratch.
777 <Step Performance="required">
779 Briefly test that the backend will start and run by running it from
784 <Step Performance="required">
786 Start the postmaster daemon running in the background by typing
794 <Step Performance="required">
796 Create a database by typing
802 <Step Performance="required">
804 Connect to the new database:
810 <Step Performance="required">
812 And run a sample query:
814 postgres=> SELECT datetime 'now';
818 <Step Performance="required">
820 Exit <application>psql</application>:
826 <Step Performance="required">
828 Remove the test database (unless you will want to use it later for other tests):
836 <Step Performance="required">
838 Run postmaster in the background from your <ProductName>Postgres</ProductName>
839 superuser account (typically account <literal>postgres</literal>).
840 <emphasis>Do not run <application>postmaster</application>
841 from the root account!</emphasis>
844 Usually, you will want to modify
845 your computer so that it will automatically start postmaster whenever
846 it boots. It is not required; the <ProductName>Postgres</ProductName>
848 be run successfully from non-privileged accounts without root intervention.
851 Here are some suggestions on how to do this, contributed by various
855 Whatever you do, postmaster must be run by
856 the <ProductName>Postgres</ProductName> superuser (<literal>postgres</literal>?)
857 <emphasis>and not by root</emphasis>.
858 This is why all of the examples below start by switching user
859 (su) to postgres. These commands also take into account the fact
860 that environment variables like PATH and PGDATA may not be set properly.
862 The examples are as follows. Use them with extreme caution.
864 <itemizedlist mark="bullet">
867 If you are installing from a non-privileged account and have no root access, then
868 start the <application>postmaster</application> and send it to the background:
872 $ nohup postmaster > regress.log 2>&1 &
878 Edit file rc.local on NetBSD or file rc2.d on SPARC Solaris
879 2.5.1 to contain the following single line:
881 su postgres -c "/usr/local/pgsql/bin/postmaster -S -D /usr/local/pgsql/data"
888 In FreeBSD 2.2-RELEASE edit /usr/local/etc/rc.d/pgsql.sh to
889 contain the following lines and make it chmod 755 and chown
894 [ -x /usr/local/pgsql/bin/postmaster ] && {
895 su -l pgsql -c 'exec /usr/local/pgsql/bin/postmaster
896 -D/usr/local/pgsql/data
897 -S -o -F > /usr/local/pgsql/errlog' &
902 You may put the line breaks as shown above. The shell is smart
903 enough to keep parsing beyond end-of-line if there is an
904 expression unfinished. The exec saves one layer of shell under
905 the postmaster process so the parent is init.
911 In RedHat Linux add a file <filename>/etc/rc.d/init.d/postgres.init</filename>
912 which is based on the example in <filename>contrib/linux/</filename>.
913 Then make a softlink to this file from
914 <filename>/etc/rc.d/rc5.d/S98postgres.init</filename>.
920 In RedHat Linux edit file /etc/inittab to add the
921 following as a single line:
924 pg:2345:respawn:/bin/su - postgres -c
925 "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data
926 >> /usr/local/pgsql/server.log 2>&1 </dev/null"
929 (The author of this example says this example will revive the
930 postmaster if it dies, but he doesn't know if there are other side
940 <Step Performance="required">
942 Run the regression tests.
943 The file <filename>/usr/src/pgsql/src/test/regress/README</filename> has detailed
944 instructions for running and interpreting the regression tests.
945 A short version follows here:
950 <Step Performance="required">
954 $ cd /usr/src/pgsql/src/test/regress
961 You do not need to type <command>gmake clean</command>
962 if this is the first time you
963 are running the tests.
967 You should get on the screen (and also written to file <filename>./regress.out</filename>)
968 a series of statements stating which tests passed and which tests
969 failed. Please note that it can be normal for some tests to
970 "fail" on some platforms.
971 The script says a test has failed if there is any difference
972 at all between the actual output of the test and the expected output.
973 Thus, tests may "fail" due to minor differences in wording of error
974 messages, small differences in floating-point roundoff, etc, between
975 your system and the regression test reference platform.
976 "Failures" of this type do not indicate a problem with
977 <ProductName>Postgres</ProductName>.
978 The file <filename>./regression.diffs</filename> contains the textual differences between
979 the actual test output on your machine and the "expected" output
980 (which is simply what the reference system produced). You should
981 carefully examine each difference listed to see whether it appears to
982 be a significant issue.
991 For a i686/Linux-ELF platform, no tests failed since this is the
992 v6.4 regression testing reference platform.
998 For the SPARC/Linux-ELF platform, using the 970525 beta version of
999 <ProductName>Postgres</ProductName> v6.2 the following tests "failed":
1000 float8 and geometry "failed" due to minor precision differences in
1001 floating point numbers. select_views produces massively different output,
1002 but the differences are due to minor floating point differences.
1009 Even if a test result clearly indicates a real failure, it may be a
1010 localized problem that will not affect you. An example is that the
1011 <type>int8</type> test will fail, producing obviously incorrect output, if your
1012 machine and C compiler do not provide a 64-bit integer data type
1013 (or if they do but configure didn't discover it). This is not
1014 something to worry about unless you need to store 64-bit integers.
1018 Conclusion? If you do see failures, try to understand the nature of
1019 the differences and then decide if those differences will affect your
1020 intended use of <ProductName>Postgres</ProductName>. The regression
1021 tests are a helpful tool, but they may require some study to be useful.
1025 After running the regression tests, type
1028 $ destroydb regression
1029 $ cd /usr/src/pgsql/src/test/regress
1033 to recover the disk space used for the tests. (You may want to save
1034 the <filename>regression.diffs</filename> file in another place before doing this.)
1040 <Step Performance="required">
1042 If you haven't already done so, this would be a good time to modify
1043 your computer to do regular maintainence. The following should be
1044 done at regular intervals:
1047 <title>Minimal Backup Procedure</title>
1049 <step performance="required">
1051 Run the <acronym>SQL</acronym> command <command>VACUUM</command>.
1052 This will clean up your database.
1055 <step performance="required">
1057 Back up your system. (You should probably keep the last few
1058 backups on hand.) Preferably, no one else should be using the
1065 Ideally, the above tasks should be done by a shell script that is
1066 run nightly or weekly by cron.
1067 Look at the man page for <application>crontab</application>
1068 for a starting point on how to do this. (If you do it, please
1069 e-mail us a copy of your shell script. We would like to set up
1070 our own systems to do this too.)
1074 <Step Performance="required">
1076 If you are upgrading an existing system then reinstall your old database.
1080 $ psql -e template1 < db.out
1083 If your pre-v6.2 database uses either path or polygon geometric data types,
1084 then you will need to upgrade any columns containing those types. To
1085 do so, type (from within psql)
1087 UPDATE <replaceable>FirstTable</replaceable> SET <replaceable>PathCol</replaceable> = UpgradePath(<replaceable>PathCol</replaceable>);
1088 UPDATE <replaceable>SecondTable</replaceable> SET <replaceable>PathCol</replaceable> = UpgradePath(<replaceable>PathCol</replaceable>);
1093 UpgradePath() checks to see that a path value is consistant with the
1094 old syntax, and will not update a column which fails that examination.
1095 UpgradePoly() cannot verify that a polygon is in fact from an old
1096 syntax, but RevertPoly() is provided to reverse the effects of a
1097 mis-applied upgrade.
1101 <Step Performance="required">
1103 If you are a new user, you may wish to play with <ProductName>Postgres</ProductName> as described
1108 <Step Performance="required">
1110 Clean up after yourself. Type
1112 $ rm -rf /usr/src/pgsql_6_0
1113 $ rm -rf /usr/local/pgsql_6_0
1114 # Also delete old database directory tree if it is not in
1115 # /usr/local/pgsql_6_0/data
1116 $ rm ~/postgresql-v6.2.1.tar.gz
1121 <Step Performance="required">
1123 You will probably want to print out the documentation. If you have
1124 a Postscript printer, or have your machine already set up to accept
1125 Postscript files using a print filter, then to print the User's Guide
1129 $ cd /usr/local/pgsql/doc
1130 $ gunzip user.ps.tz | lpr
1135 you might do it if you have Ghostscript on your system and are
1136 writing to a laserjet printer.
1139 $ alias gshp='gs -sDEVICE=laserjet -r300 -dNOPAUSE'
1140 $ export GS_LIB=/usr/share/ghostscript:/usr/share/ghostscript/fonts
1142 $ gshp -sOUTPUTFILE=user.hp user.ps
1144 $ lpr -l -s -r manpage.hp
1149 <Step Performance="required">
1151 The <ProductName>Postgres</ProductName> team wants
1152 to keep <ProductName>Postgres</ProductName> working on all of the
1153 supported platforms. We therefore ask you to let us know if you did
1154 or did not get <ProductName>Postgres</ProductName> to work on you system.
1157 <ulink url="mailto:pgsql-ports@postgresql.org">pgsql-ports@postgresql.org</ulink>
1158 telling us the following:
1163 The version of <ProductName>Postgres</ProductName> (v6.4, 6.3.2, beta 981014, etc.).
1169 Your operating system (i.e. RedHat v5.1 Linux v2.0.34).
1175 Your hardware (SPARC, i486, etc.).
1181 Did you compile, install and run the regression tests cleanly?
1182 If not, what source code did you change (i.e. patches you
1183 applied, changes you made, etc.), what tests failed, etc.
1184 It is normal to get many warning when you compile. You do
1185 not need to report these.
1194 <Step Performance="required">
1196 Now create, access and manipulate databases as desired. Write client
1197 programs to access the database server. In other words, <emphasis>enjoy</emphasis>!
1204 <Title>Playing with <ProductName>Postgres</ProductName></Title>
1207 After <ProductName>Postgres</ProductName> is installed, a database system is created, a postmaster
1208 daemon is running, and the regression tests have passed, you'll want to
1209 see <ProductName>Postgres</ProductName> do something. That's easy. Invoke the interactive interface
1210 to <ProductName>Postgres</ProductName>, <Application>psql</Application>:
1216 (psql has to open a particular database, but at this point the only one
1217 that exists is the template1 database, which always exists. We will connect
1218 to it only long enough to create another one and switch to it.)
1222 The response from psql is:
1225 Welcome to the POSTGRESQL interactive sql monitor:
1226 Please read the file COPYRIGHT for copyright terms of POSTGRESQL
1228 type \? for help on slash commands
1230 type \g or terminate with semicolon to execute query
1231 You are currently connected to the database: template1
1238 Create the database foo:
1241 template1=> create database foo;
1245 (Get in the habit of including those SQL semicolons. Psql won't execute
1246 anything until it sees the semicolon or a "\g" and the semicolon is required
1247 to delimit multiple statements.)
1251 Now connect to the new database:
1255 connecting to new database: foo
1258 ("slash" commands aren't SQL, so no semicolon. Use \? to see all the slash commands.)
1265 foo=> create table bar (i int4, c char(16));
1271 Then inspect the new table:
1277 +----------------------------------+----------------------------------+-------+
1278 | Field | Type | Length|
1279 +----------------------------------+----------------------------------+-------+
1281 | c | (bp)char | 16 |
1282 +----------------------------------+----------------------------------+-------+
1287 And so on. You get the idea.
1292 <Title>The Next Step</Title>
1295 Questions? Bugs? Feedback?
1296 First, read the files in directory <filename>/usr/src/pgsql/doc/</filename>.
1297 The FAQ in this directory may be particularly useful.
1301 If <ProductName>Postgres</ProductName> failed to compile on your computer
1302 then fill out the form in file <filename>/usr/src/pgsql/doc/bug.template</filename>
1303 and mail it to the location indicated at the top of the form.
1307 Check on the web site at
1308 <ULink url="http://www.postgresql.org">http://www.postgresql.org</ULink>
1309 For more information on the various support mailing lists.
1314 <Title>Porting Notes</Title>
1318 Check for any platform-specific FAQs in the <filename>doc/</filename> directory of
1319 the source distribution. For some ports, the notes below may be out of date.
1324 <Title>Ultrix4.x</Title>
1329 There have been no recent reports of Ultrix usage with <productname>Postgres</productname>.
1334 You need to install the libdl-1.1 package since Ultrix 4.x doesn't
1335 have a dynamic loader. It's available in
1336 s2k-ftp.CS.Berkeley.EDU:pub/personal/andrew/libdl-1.1.tar.Z
1341 <Title>Linux</Title>
1346 <FirstName>Thomas G.</FirstName>
1347 <SurName>Lockhart</SurName>
1349 <Date>1998-02-19</Date>
1351 <Title>Linux ELF</Title>
1354 The regression test reference machine is
1355 a linux-2.0.30/libc-5.3.12/RedHat-4.2 installation running on a dual processor i686.
1356 The linux-elf port installs cleanly. See the Linux FAQ for more details.
1362 <Date>1995-05-11</Date>
1364 <Title>Linux a.out</Title>
1367 For non-ELF Linux, the dld library MUST be obtained and installed on
1368 the system. It enables dynamic link loading capability to the <ProductName>Postgres</ProductName>
1369 port. The dld library can be obtained from the sunsite linux
1370 distributions. The current name is dld-3.2.5.
1371 <ULink url="sneaker@powergrid.electriciti.com">Jalon Q. Zimmerman</ULink>
1377 <Title>BSD/OS</Title>
1380 For BSD/OS 2.0 and 2.01, you will need to get the GNU dld library.
1388 The NeXT port for v1.09 was supplied by
1389 <ULink url="mailto:tom@basil.icce.rug.nl">Tom R. Hageman</ULink>.
1390 It requires a SysV IPC emulation library and header files for
1391 shared libary and semaphore stuff. Tom just happens to sell such
1392 a product so contact him for information. He has also indicated that
1393 binary releases of <ProductName>Postgres</ProductName> for NEXTSTEP will be made available to
1394 the general public. Contact Info@RnA.nl for information.
1397 We have no recent reports of successful NeXT installations (as of v6.2.1).
1398 However, the client-side libraries should work even
1399 if the backend is not supported.