OSDN Git Service

pg_password utility. Cleanup for psql passwords. New datetime contrib stuff for...
[pg-rex/syncrep.git] / INSTALL
1 POSTGRESQL INSTALLATION INSTRUCTIONS
2 Copyright (c) 1997 Regents of  the University of California
3
4 This is file /usr/src/pgsql/INSTALL.  It contains notes on how to install
5 PostgreSQL v6.1.1.  Up to date information on PostgreSQL may be found at
6 http://www.postgresql.org.
7
8 PostgreSQL is an RDBMS database server.  It is not completely ANSI SQL
9 compliant, but with each release it gets closer.
10
11 PostgreSQL, formerly called Postgres95, is a derivative of Postgres 4.2
12 (the last release of the UC Berkeley research project).  For copyright
13 terms for PostgreSQL, please see the file named COPYRIGHT.  This version
14 was developed by a team of developers on the postgres developers mailing
15 list.  Version 1 (through 1.01) was developed by Jolly Chen and Andrew
16 Yu.
17
18 The installation notes below assume the following (except where noted):
19   - Commands are Unix-compatible. See note below.
20   - Defaults are used except where noted.
21   - User postgres is the postgres superuser.
22   - The source path is /usr/src/pgsql (other paths are possible).
23   - The runtime path is /usr/local/pgsql (other paths are possible).
24
25 Commands were tested on RedHat Linux version 4.0 using the bash shell.
26 Except where noted, they will probably work on most systems. Commands
27 like ps and tar vary wildly on what options you should use on each
28 platform. USE COMMON SENSE before typing in these commands.
29
30 Our Makefiles require GNU make (called gmake in this document) and
31 also assume that "install" accepts BSD options. The INSTALL
32 variable in the Makefiles is set to the BSD-compatible version of
33 install. On some systems, you will have to find a BSD-compatible
34 install command (eg. bsdinst, which comes with the MIT X Window System
35 distribution) 
36
37
38 REQUIREMENTS TO RUN POSTGRESQL
39 ------------------------------
40
41 PostgreSQL has been tested on the following platforms:
42
43    aix            IBM on AIX 3.2.5 or 4.x
44    alpha          DEC Alpha AXP on Digital Unix 2.0, 3.2, 4.0
45    BSD44_derived  OSs derived from 4.4-lite BSD (NetBSD, FreeBSD)
46    bsdi           BSD/OS 2.0, 2.01, 2.1, 3.0
47    dgux           DG/UX 5.4R4.11
48    hpux           HP PA-RISC on HP-UX 9.0, 10
49    i386_solaris   i386 Solaris
50    irix5          SGI MIPS on IRIX 5.3
51    linux          Intel x86 on Linux 2.0 and Linux ELF
52                   SPARC on Linux ELF
53                   PPC on Linux ELF
54                   (For non-ELF Linux, see LINUX_ELF below).
55    sco            SCO 3.2v5
56    sparc_solaris  SUN SPARC on Solaris 2.4, 2.5, 2.5.1
57    sunos4         SUN SPARC on SunOS 4.1.3
58    svr4           Intel x86 on Intel SVR4 and MIPS
59    ultrix4        DEC MIPS on Ultrix 4.4
60
61 PostgreSQL has known problems/bugs on the following platforms:
62
63    nextstep       Motorola MC68K or Intel x86 on NeXTSTEP 3.2
64
65 PostgreSQL is also known to work on a number of other platforms that the
66 authors have not personally tested.
67
68 You should have at least 8 MB of memory and at least 45 MB of disk space
69 to hold the source, binaries, and user databases.  After installation
70 you may reduce this to about 3 Mbytes plus space for user databases.
71
72 To upgrade from PostgreSQL v6.1 to v6.1.1 do the following:
73 -----------------------------------------------------------
74    1) Run configure on the new release
75    2) Compile the new release
76    3) Recompile your custom applications to use the new libpq library
77    4) Stop the postmaster
78    5) Install the new release
79    6) Restart the postmaster
80
81 To those doing a fresh install or upgrading to PostgreSQL v6.1.1 
82 from 6.0 or 1.* release, do the following:
83 ----------------------------------------------
84
85   1) Read any last minute information and platform specific porting
86      notes.  There are some platform specific notes at the end of this
87      file for Ultrix4.x, Linux, BSD/OS and NeXT.  There are other
88      files in directory /usr/src/pgsql/doc, including files FAQ-Irix
89      and FAQ-Linux.  Also look in directory ftp://ftp.postgresql.org/pub.
90      If there is a file called INSTALL in this directory then this
91      file will contain the latest installation information.
92
93      Please note that a "tested" platform in the list given earlier
94      simply means that someone went to the effort at some point of making
95      sure that a PostgreSQL distribution would compile and run on this
96      platform without modifying the code.  Since the current developers
97      will not have access to all of these platforms, some of them may not
98      compile cleanly and pass the regression tests in the current
99      release due to minor problems.  Any such known problems and their
100      solutions will be posted in ftp://ftp.postgresql.org/pub/INSTALL.
101
102   2) Create account postgres if it does not already exist.
103
104   3) Log into account postgres.
105
106   3a) Check that you have sufficient disk space.  You will need about
107       17 Mbytes for /usr/src/pgsql, about 2 Mbytes for /usr/local/pgsql
108       (excluding your database) and 1 Mbyte for an empty database.
109       The database will temporarily grow to about 20 Mbytes during the
110       regression tests.  You will also need about 3 Mbytes for the
111       distribution tar file.
112
113       We therefore recommend that during installation and testing you
114       have well over 20 Mbytes free under /usr/local and another 25 Mbytes
115       free on the disk partition containing your database.  Once you
116       delete the source files, tar file and regression database, you
117       will need 2 Mbytes for /usr/local/pgsql, 1 Mbyte for the empty
118       database, plus about five times the space you would require to
119       store your database data in a flat file.
120
121       To check for disk space, use command "df -k".
122
123   4) Ftp file ftp://ftp.postgresql.org/pub/postgresql-v6.1.1.tar.gz from the
124      internet.  Store it in your home directory.
125
126   5) Some platforms use flex.  If your system uses flex then make sure
127      you have a good version.  Type
128         flex --version
129
130      If the flex command is not found then you probably do not need it.
131      If the version is 2.5.2 or 2.5.4 or greater then you are okay.  If it
132      is 2.5.3 or before 2.5.2 then you will have to upgrade flex.  You may
133      get it at ftp://prep.ai.mit.edu/pub/gnu/flex-2.5.4.tar.gz.
134
135      If you need flex and don't have it or have the wrong version, then
136      you will be told so when you attempt to compile the program.  Feel
137      free to skip this step if you aren't sure you need it.  If you do
138      need it then you will be told to install/upgrade flex when you try to
139      compile.
140
141      To install it, type the following:
142         cd
143         gunzip -c flex-2.5.4.tar.gz | tar xvf -
144         cd flex-2.5.4
145         configure --prefix=/usr
146         make
147         make check
148         # You must be root when typing the next line.
149         make install
150         cd
151         rm -rf flex-2.5.4
152
153      This will update files /usr/man/man1/flex.1, /usr/bin/flex,
154      /usr/lib/libfl.a, /usr/include/FlexLexer.h and will add link
155      /usr/bin/flex++ which points to flex.
156
157   6) If you are upgrading an existing system then back up your database.
158      The database format is liable to change every few weeks with no
159      notice besides a quick comment in the HACKERS mailing list.  It is
160      therefore a bad idea to skip this step.  Also, do not use the
161      pg_dumpall script from v6.0 or everything will be owned by the
162      postgres super user.  Type (with the gunzip line and the following
163      line typed as one line):
164         cd
165         gunzip -c postgresql-v6.1.1.tar.gz |
166             tar xvf - src/bin/pg_dump/pg_dumpall
167         chmod a+x src/bin/pg_dump/pg_dumpall
168         src/bin/pg_dump/pg_dumpall > db.out
169         rm -rf src
170      If you wish to preserve object id's (oids), then use the -o
171      option when running pg_dumpall.  However, unless you have a
172      special reason for doing this, don't do it.
173
174      If the pg_dumpall command seems to take a long time and you think
175      it might have died, then, from another terminal, use "ls -l db.out"
176      several times to see if the size of the file is growing.
177
178      Please note that if you are upgrading from a version prior to
179      Postgres95 v1.09 then you must back up your database, install
180      Postgres95 v1.09, restore your database, then back it up again.
181      You should also read files /usr/src/pgsql/migration/*.
182
183      You must make sure that your database is not updated in the middle of
184      your backup.  If necessary, bring down postmaster, edit the permissions
185      in file /usr/local/pgsql/data/pg_hba.conf to allow only you on, then
186      bring postmaster back up.
187
188   7) If you are upgrading an existing system then kill the postmaster.  Type
189        ps -ax | grep postmaster
190      This should list the process numbers for a number of processes.  Type
191      the following line, with "???" replaced by the process id for process
192      "postmaster".  (Do not use the id for process "grep postmaster".)  Type
193        kill ???
194      with "???" modified as indicated.
195
196   8) If you are upgrading an existing system then move the old directories
197      out of the way.  If you are short of disk space then you may have to
198      back up and delete the directories instead.  If you do this, save the
199      old database in the /usr/local/pgsql/data directory tree.  At a
200      minimum, save file /usr/local/pgsql/data/pg_hba.conf.
201
202      Type the following:
203         su
204         cd /usr/src
205         mv pgsql pgsql_6_0
206         cd /usr/local
207         mv pgsql pgsql_6_0
208         exit
209
210      If you are not using /usr/local/pgsql/data as your data directory
211      (check to see if environment variable PGDATA is set to something
212      else) then you will also want to move this directory in the same
213      manner.
214
215   9) Make new source and install directories.  The actual paths can be
216      different for your installation; be consistant with your configuration
217      in step (11).
218      Type
219         su
220         cd /usr/src
221         mkdir pgsql
222         chown postgres:postgres pgsql
223         cd /usr/local
224         mkdir pgsql
225         chown postgres:postgres pgsql
226         exit
227
228  10) Unzip and untar the new source file.  Type
229         cd /usr/src/pgsql
230         gunzip -c ~/postgresql-v6.1.1.tar.gz | tar xvf -
231
232  11) Configure the source code for your system.  It is this step at which
233      you can specify your actual source path and installation paths for
234      the build process (see the --prefix option below).  Type
235         cd /usr/src/pgsql/src
236         ./configure
237
238      The configure program will list the template files available and
239      ask you to choose one.  A lot of times, an appropriate template
240      file is chosen for you, and you can just press Enter to accept the
241      default.  If the default is not appropriate, then type in the
242      appropriate template file and press Enter.  (If you do this, then
243      send email to scrappy@hub.org stating the output of the program
244      './config.guess' and what the template file should be.)
245
246      Once you have entered the template file, you will be asked a
247      number of questions about your particular configuration.  These
248      can be skipped by adding parameters to the configure command above.
249      The following parameters can be tagged onto the end of the configure
250      command:
251
252        --prefix=BASEDIR   Selects a different base directory for the
253                           installation of the PostgreSQL configuration.
254                           The default is /usr/local/pgsql.
255
256        --enable-hba       Enables Host Based Authentication
257
258        --disable-hba      Disables Host Based Authentication
259
260        --enable-locale    Enables USE_LOCALE
261
262        --disable-locale   Disables USE_LOCALE
263
264        --enable-cassert   Enables ASSERT_CHECKING
265
266        --disable-cassert  Disables ASSERT_CHECKING
267
268                           The default for ASSERT_CHECKING is normally
269                           enabled for development versions and
270                           disabled for release versions of PostgreSQL.
271                 
272        --with-template=TEMPLATE
273                           Use template file TEMPLATE - the template
274                           files are assumed to be in the directory
275                           src/template, so look there for proper values.
276                           (If the configure script cannot find the
277                           specified template file, it will ask you for
278                           one).
279
280        --with-pgport=PORT Sets the port that the postmaster process
281                           listens for incoming connections on.  The
282                           default for this is port 5432.
283
284      As an example, here is the configure script I use on a Sparc
285      Solaris 2.5 system with /opt/postgres being the install base.
286
287        % ./configure --prefix=/opt/postgres 
288                 --with-template=sparc_solaris-gcc --with-pgport=5432
289                 --enable-hba --disable-locale
290
291      Of course, in a real shell, you would type these three lines all
292      on the same line.
293
294  12) Compile the program.  Type
295         cd /usr/src/pgsql/src
296         gmake all >& make.log &
297         tail -f make.log
298
299      The last line displayed will hopefully be "All of PostgreSQL is
300      successfully made. Ready to install."  At this point, or earlier
301      if you wish, type control-C to get out of tail.  (If you have
302      problems later on you may wish to examine file make.log for
303      warning and error messages.)
304
305      If your computer does not have gmake (GNU make) then try running
306      make instead throughout the rest of these notes.
307
308      Please note that you will probably find a number of warning
309      messages in make.log.  Unless you have problems later on, these
310      messages may be safely ignored.
311
312      If the compiler fails with an error stating that the flex command
313      cannot be found then install flex as described earlier.  Next,
314      change directory back to this directory, type "make clean", then
315      recompile again.
316
317  13) Install the program.  Type
318         cd /usr/src/pgsql/src
319         gmake install >& make.install.log &
320         tail -f make.install.log
321
322      The last line displayed will be "gmake[1]: Leaving directory
323      `/usr/src/pgsql/src/man'".  At this point, or earlier if you wish,
324      type control-C to get out of tail.
325
326  14) If necessary, tell UNIX how to find your shared libraries.  If you
327      are using Linux-ELF do ONE of the following, preferably the first:
328
329        a) As root, edit file /etc/ld.so.conf.  Add line
330              /usr/local/pgsql/lib
331           to the file.  Then run command /sbin/ldconfig.
332
333        b) In a bash shell, type
334              export LD_LIBRARY_PATH=/usr/local/pgsql/lib
335
336        c) In a csh shell, type
337              setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
338
339      Please note that the above commands may vary wildly for different
340      operating systems.  Check the platform specific notes, such as
341      those for Ultrix4.x or and for non-ELF Linux.
342
343      If, when you create the database, you get the message "pg_id: can't
344      load library 'libpq.so'" then the above step was necessary.  Simply
345      do this step, then try to create the database again.
346
347  15) If it has not already been done, then prepare account postgres
348      for using PostgreSQL.  Any account that will use PostgreSQL must
349      be similarily prepared.  (The following instructions are for a
350      bash shell.  Adapt accordingly for other shells.)
351
352      Add the following lines to your login shell, ~/.bash_profile:
353         PATH=$PATH:/usr/local/pgsql/bin
354         MANPATH=$MANPATH:/usr/local/pgsql/man
355         PGLIB=/usr/local/pgsql/lib
356         PGDATA=/usr/local/pgsql/data
357         export PATH MANPATH PGLIB PGDATA
358
359      Make sure that you have defined these variables before continuing
360      with the remaining steps.  The easiest way to do this is to type:
361         source ~/.bash_profile
362
363  16) Create the database.  DO NOT DO THE FOLLOWING AS ROOT!  This would
364      be a major security hole.  Type
365         initdb
366
367  17) Set up permissions to access the database system.  Do this by editing
368      file /usr/local/pgsql/data/pg_hba.conf.  The instructions are
369      included in the file.  (If your database is not located in the
370      default location, i.e. if PGDATA is set to point elsewhere, then the
371      location of this file will change accordingly.)  This file should be
372      made read only again once you are finsihed.
373
374      If you are upgrading from v6.0 you can copy file pg_hba.conf from
375      your old database on top of the one in your new database, rather than
376      redoing this from scratch.
377
378  18) If you wish to skip the regression tests then skip to step 21.
379      However, we think skipping the tests is a BAD idea!
380
381      The file /usr/src/pgsql/src/test/regress/README has detailed
382      instructions for running and interpreting the regression tests.
383      A short version follows here:
384
385      Start the postmaster in preparation for the regression tests.  First,
386      set the timezone for Berkeley, California.  On some systems you may do
387      this by setting environment variable TZ.  I.e., using bash, type
388         export TZ=PST8PDT
389
390      Now start the postmaster daemon running in the background by typing
391         cd
392         nohup postmaster > regress.log 2>&1 &
393
394      Run postmaster from your postgres super user account (typically
395      account postgres).  DO NOT RUN POSTMASTER FROM THE ROOT ACCOUNT.
396
397  19) Run the regression tests.  Type
398
399         cd /usr/src/pgsql/src/test/regress
400         gmake clean
401         gmake all runtest
402
403      You do not need to type "gmake clean" if this is the first time you
404      are running the tests.
405
406      You should get on the screen (and also written to file ./regress.out)
407      a series of statements stating which tests passed and which tests
408      failed.  Please note that it can be normal for some of the tests to
409      "fail".  For the failed tests, use diff to compare the files in
410      directories ./results and ./expected.  If float8 failed, type
411      something like:
412         cd /usr/src/pgsql/src/test/regress
413         diff -w expected/float8.out results
414
415     "Failed" tests may have failed due to slightly different error messages,
416      output formatting, failure to set the timezone correctly for your
417      platform, etc.  "Failures" of this type do not indicate a problem with
418      PostgreSQL.
419
420      Here is an example from a i686/Linux-ELF platform (this is the platform
421      on which most of the regression tests were generated). No tests failed
422      since this is the v6.1.1 regression reference platform.
423
424      Here is an example from the SPARC/Linux-ELF platform.  Using the
425      970525 beta version of PostgreSQL v6.1.1 the following tests "failed".
426      float8 and geometry "failed" due to minor precision differences in
427      floating point numbers.  select_views produces massively different output,
428      but the differences are due to minor floating point differences.
429
430      Conclusion?  If you do see failures, try to understand the nature of
431      the differences and then decide if those differences will affect your
432      intended use of PostgreSQL.  However, keep in mind that this is likely
433      to be the most solid release of PostgreSQL to date, incorporating many
434      bug fixes from v6.0, and that previous versions of PostgreSQL have been
435      in use successfully for some time now.
436
437      After running the tests, type
438         destroydb regression
439         cd /usr/src/pgsql/src/test/regress
440         gmake clean
441
442  20) Stop the postmaster as described in step 7.  Then restore the
443      timezone to it's normal setting.  If you changed the timezone by
444      modifying environment variable TZ then one way to do this is to
445      log out of, then back into, account postgres.
446
447  21) Start the postmaster daemon running.  Type
448         cd
449         nohup postmaster > server.log 2>&1 &
450      Run postmaster from your postgres super user account (typically
451      account postgres).  DO NOT RUN POSTMASTER FROM THE ROOT ACCOUNT.
452
453  22) If you haven't already done so, this would be a good time to modify
454      your computer so that it will automatically start postmaster whenever
455      you boot your computer.
456
457      Here are some suggestions on how to do this, contributed by various
458      users.
459
460      Whatever you do, postmaster must be run by user postgres, AND NOT BY
461      ROOT.  This is why all of the examples below start by switching user
462      (su) to postgres.  These commands also take into account the fact
463      that environment variables like PATH and PGDATA may not be set properly.
464
465      The examples are as follows.  Use them with extreme caution.
466
467        a) Edit file rc.local on NetBSD or file rc2.d on SPARC Solaris
468           2.5.1 to contain the following single line:
469              su postgres -c "/usr/local/pgsql/bin/postmaster -S -D
470                      /usr/local/pgsql/data"
471
472        b) In RedHat v4.0 Linux edit file /etc/inittab to contain the
473           following single line:
474              pg:2345:respawn:/bin/su - postgres -c
475                      "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data
476                      >> /usr/local/pgsql/server.log 2>&1" /dev/null
477           (The author of this example says this example will revive the
478           postmaster if it dies, but he doesn't know if there are other side
479           effects.)
480
481        c) In FreeBSD 2.2-RELEASE edit /usr/local/etc/rc.d/pgsql.sh to
482           contain the following lines and make it chmod 755 and chown
483           root:bin.
484              #!/bin/sh
485              [ -x /usr/local/pgsql/bin/postmaster ] && {
486                su -l pgsql -c 'exec /usr/local/pgsql/bin/postmaster
487                        -D/usr/local/pgsql/data
488                        -S -o -F > /usr/local/pgsql/errlog' &
489                echo -n ' pgsql'
490              }
491           You may put the line breaks as shown above.  The shell is smart
492           enough to keep parsing beyond end-of-line if there is an
493           expression unfinished.  The exec saves one layer of shell under
494           the postmaster process so the parent is init.  Note:  Unlike the
495           other examples, this one has been tested.
496
497        d) In RedHat v4.0 Linux create file /etc/rc.d/init.d/postgres.init to
498           contain the following single line:
499              su -c "cd ~postgres; nohup /usr/local/pgsql/bin/postmaster
500                      -D /usr/local/pgsql/data  > server.log 2>&1 &" postgres
501           Next, type the following:
502              cd /etc/rc3.d
503              ln -s ../init.d/postgres.init S1000postgres
504           Change "1000" to a number of your choice to indicate the
505           loading order of the various programs pointed to in directory
506           /etc/rc3.d.  (Note that this example has not been tested yet.)
507
508  22a) If you haven't already done so, this would be a good time to modify
509       your computer to do regular maintainence.  The following should be
510       done at regular intervals:
511
512         a) Run the SQL command vacuum.  This will clean up your database.
513         b) Back up your system.  (You should probably keep the last few
514            backups on hand.)  Ideally, no one else should be using the
515            system at the time.
516
517       Ideally, the above tasks should be done by a shell script that is
518       run nightly or weekly by cron.  Look at the man page for crontab
519       for a starting point on how to do this.  (If you do it, please
520       e-mail us a copy of your shell script.  We would like to set up
521       our own systems to do this too.)
522
523  23) If you are upgrading an existing system then install your old database.
524      Type
525         cd
526         psql -e template1 < db.out
527
528      If your old database uses either path or polygon geometric data types,
529      then you will need to upgrade any columns containing those types. To
530      do so, type (from within psql)
531         update YourTable set PathCol = UpgradePath(PathCol);
532         update YourTable set PolyCol = UpgradePoly(PolyCol);
533         ...
534         vacuum;
535
536      UpgradePath() checks to see that a path value is consistant with the
537      old syntax, and will not update a column which fails that examination.
538      UpgradePoly() cannot verify that a polygon is in fact from an old
539      syntax, but RevertPoly() is provided to reverse the effects of a
540      mis-applied upgrade.
541
542  24) If you are a new user, you may wish to play with postgres as described
543      below.
544
545  25) Clean up after yourself.  Type
546         rm -rf /usr/src/pgsql_6_0
547         rm -rf /usr/local/pgsql_6_0
548         # Also delete old database directory tree if it is not in
549         #  /usr/local/pgsql_6_0/data
550         rm ~/postgresql-v6.1.1.tar.gz
551
552  26) You will probably want to print out the documentation.  Here is how
553      you might do it if you have Ghostscript on your system and are
554      writing to a laserjet printer.
555         alias gshp='gs -sDEVICE=laserjet -r300 -dNOPAUSE'
556         export GS_LIB=/usr/share/ghostscript:/usr/share/ghostscript/fonts
557         # Print out the man pages.
558         man -a -t /usr/local/pgsql/man/*/* > manpage.ps
559         gshp -sOUTPUTFILE=manpage.hp manpage.ps
560         rm manpage.ps
561         lpr -l -s -r manpage.hp
562         # Print out the Postgres95 User Manual, version 1.0,
563         #  Sept. 5, 1996.
564         cd /usr/src/pgsql/doc
565         gshp -sOUTPUTFILE=userguide.hp userguide.ps
566         lpr -l -s -r userguide.hp
567
568      If you are a developer, you will probably want to also print out
569      the Postgres Implemention Guide, version 1.0, October 1, 1995.
570      This is a WWW document located at
571      http://www.postgresql.org/docs/impguide.
572
573  27) The Postgres team wants to keep PostgreSQL working on all of the
574      supported platforms.  We therefore ask you to let us know if you did
575      or did not get PostgreSQL to work on you system.  Please send a
576      mail message to pgsql-ports@postgresql.org telling us the following:
577        - The version of PostgreSQL (v6.1, 6.1.1, beta 970703, etc.).
578        - Your operating system (i.e. RedHat v4.0 Linux v2.0.26).
579        - Your hardware (SPARC, i486, etc.).
580        - Did you compile, install and run the regression tests cleanly?
581          If not, what source code did you change (i.e. patches you
582          applied, changes you made, etc.), what tests failed, etc.
583          It is normal to get many warning when you compile.  You do
584          not need to report these.
585
586  28) Now create, access and manipulate databases as desired.  Write client
587      programs to access the database server.  In other words, ENJOY!
588
589
590 PLAYING WITH POSTGRESQL
591 -----------------------
592
593 After PostgreSQL is installed, a database system is created, a postmaster
594 daemon is running, and the regression tests have passed, you'll want to 
595 see PostgreSQL do something.  That's easy.  Invoke the interactive interface
596 to PostgreSQL, psql, and start typing SQL:
597
598   $ psql template1
599
600 (psql has to open a particular database, but at this point the only one
601 that exists is the template1 database, which always exists.  We will connect
602 to it only long enough to create another one and switch to it).
603
604 The response from psql is:
605
606   type \? for help on slash commands
607   type \q to quit
608   type \g or terminate with semicolon to execute query
609 You are currently connected to the database: template1
610
611 template1=> 
612
613 Create the database foo:
614
615 template1=> CREATE DATABASE FOO;
616 INSERT 773248
617
618 (Get in the habit of including those SQL semicolons.  Psql won't execute
619 anything until it sees the semicolon or a "\g" and the semicolon is required
620 to delimit multiple statements.)
621
622 template1=> \c foo
623 closing connection to database: template1
624 connecting to new database: foo
625
626 (\ commands aren't SQL, so no semicolon.  Use \? to see all the \ commands.)
627
628 foo=> CREATE TABLE bar (column1 int4, column2 char16);
629 CREATE
630
631 foo=> \d bar
632
633 ...
634
635 You get the idea.
636
637
638 QUESTIONS?  BUGS?  FEEDBACK?
639 ----------------------------
640
641 First, read the files in directory /usr/src/pgsql/doc.  The FAQ in
642 this directory may be particularly useful.
643
644 If PostgreSQL failed to compile on your computer then fill out the form
645 in file /usr/src/pgsql/doc/bug.template and mail it to the location
646 indicated at the top of the form.
647
648 Mail questions to pgsql-questions@postgresql.org.  For more information
649 on the various mailing lists, see http://www.postgresql.org under mailing
650 lists.
651
652
653 ----------------------------------------------------------------------
654
655 Porting Notes (these notes may be out of date):
656 -------------
657
658 Ultrix4.x:
659         You need to install the libdl-1.1 package since Ultrix 4.x doesn't
660         have a dynamic loader. It's available in
661            s2k-ftp.CS.Berkeley.EDU:pub/personal/andrew/libdl-1.1.tar.Z
662
663 Linux:
664         The linux-elf port installs cleanly. If you are using an
665         i486 processor or higher, you can edit template/linux-elf
666         to include "-m486" as a compiler option. configure does not
667         detect that sigsetjmp() is available, but you can edit
668         include/config.h after running configure and before running
669         make to include "#define HAVE_SIGSETJMP 1". Note that I have
670         not seen any difference in PostgreSQL behavior either way.
671                                 (Thomas G. Lockhart
672                                 <Thomas.Lockhart@jpl.nasa.gov> 97/05/17)
673
674         For non-ELF Linux, the dld library MUST be obtained and installed on
675         the system. It enables dynamic link loading capability to the postgres
676         port. The dld library can be obtained from the sunsite linux
677         distributions. The current name is dld-3.2.5.
678                                 (Jalon Q. Zimmerman
679                                 <sneaker@powergrid.electriciti.com> 5/11/95)
680
681 BSD/OS:
682         For BSD/OS 2.0 and 2.01, you will need to get the GNU dld library.
683
684 NeXT:
685         The NeXT port was supplied by Tom R. Hageman <tom@basil.icce.rug.nl>.
686         It requires a SysV IPC emulation library and header files for
687         shared libary and semaphore stuff.   Tom just happens to sell such
688         a product so contact him for information.  He has also indicated that
689         binary releases of PostgreSQL for NEXTSTEP will be made available to
690         the general public.  Contact Info@RnA.nl for information.
691