BSD 4_1c_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 19 Nov 1982 07:56:02 +0000 (23:56 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 19 Nov 1982 07:56:02 +0000 (23:56 -0800)
Work on file usr/src/ucb/ingres/doc/other/v5v6diff.nr
Work on file usr/src/ucb/ingres/doc/other/nmacs
Work on file usr/src/ucb/ingres/doc/other/tutorial.nr
Work on file usr/src/ucb/ingres/doc/other/howto_setup.nr
Work on file usr/src/ucb/ingres/doc/other/setup_geo.nr
Work on file usr/src/ucb/ingres/doc/other/lockdev.nr
Work on file usr/src/ucb/ingres/doc/other/v6v61diff.nr

Synthesized-from: CSRG/cd1/4.1c.2

usr/src/ucb/ingres/doc/other/howto_setup.nr [new file with mode: 0644]
usr/src/ucb/ingres/doc/other/lockdev.nr [new file with mode: 0644]
usr/src/ucb/ingres/doc/other/nmacs [new file with mode: 0644]
usr/src/ucb/ingres/doc/other/setup_geo.nr [new file with mode: 0644]
usr/src/ucb/ingres/doc/other/tutorial.nr [new file with mode: 0644]
usr/src/ucb/ingres/doc/other/v5v6diff.nr [new file with mode: 0644]
usr/src/ucb/ingres/doc/other/v6v61diff.nr [new file with mode: 0644]

diff --git a/usr/src/ucb/ingres/doc/other/howto_setup.nr b/usr/src/ucb/ingres/doc/other/howto_setup.nr
new file mode 100644 (file)
index 0000000..e2ffeee
--- /dev/null
@@ -0,0 +1,612 @@
+.ds HE 'HOW TO SET UP INGRES''PAGE %'
+.so nmacs
+.ce
+Instructions for setting up INGRES from tape.
+.ce
+(VAX UNIX*)
+
+.ce
+(January 26, 1981)
+
+This set of instructions will help you
+read INGRES version 7 in from tape and get it running on
+your system.
+If you are running any version of UNIX
+other than VM/UNIX release four,
+read this entire document
+before doing anything!,
+paying particular attention to section 5.3.
+
+*UNIX is a trademark of Bell Laboratories.
+
+.sh 1
+Installing INGRES for the first time.
+.PS
+If you already have an INGRES system,
+go directly to part 1.3.
+.dn
+Creating a UNIX user called "ingres".
+.PS
+The first thing you should do is to create a user named "ingres"
+on your system
+and log in as that user.
+The files you read in from 
+tape will be owned by "ingres",
+an actual user on your system.
+INGRES locates files in the system by
+looking in the /etc/passwd file for the
+user "ingres".
+INGRES will
+.ul
+not work
+unless you create this user.
+.sh
+Creating parent directory for the INGRES system.
+.PS
+The parent directory of the INGRES system at Berkeley is "/mnt/ingres".
+It is possible to run INGRES in a parent directory
+of your own choosing,
+which must be the parent directory of
+the user "ingres" as specified in /etc/passwd.
+For the purpose of this document the
+parent directory will be denoted by "...".
+.sh
+Extracting INGRES from the tape.
+.PS
+You are now ready to read the tape into your
+system using tar.
+You should be in the home directory for INGRES
+and logged in as INGRES.
+Type the command:
+
+       tar xf /dev/rmt0
+
+The system is now fully extracted from the tape
+and the tape can be unloaded if desired.
+.sh
+User oriented programs
+.PS
+In .../bin there is a collection of programs.
+Several programs
+are type-I commands associated with INGRES and which should be moved or
+linked into /usr/bin.
+The other programs are executed only by other
+INGRES programs and must be left in .../bin.
+After moving the files verify that they
+are still owned by "ingres",
+and are in the correct modes.
+Move only the files listed below.
+Leave the other files where they are!
+
+.in 18
+.ti -10
+copydb, creatdb, destroydb, equel, helpr,
+.ti -10
+ingres, printr, purge, restore, sysmod
+.br
+(see INGRES reference manual for an
+explanation of these commands.
+
+.ti -10
+demodb    creates a new database with a name given as an argument
+and loads it with sample data relations such as might be used by
+a department store for employee and sales records.
+The INGRES tutorial uses the relations
+in the demo database for its examples.
+
+.in -10
+It is imperative that each of these programs be in
+the correct mode.
+A sample "ls -l" is given below.
+Verify that your file modes agree with the listing.
+
+.in +10
+.nf
+-rwx--x--x 1 ingres    . . .   copydb
+-rws--x--x 1 ingres    . . .   creatdb
+-rwxr-xr-x 1 ingres    . . .   demodb
+-rws--x--x 1 ingres    . . .   destroydb
+-rwx--x--x 1 ingres    . . .   equel
+-rws--x--x 1 ingres    . . .   helpr
+-rws--x--x 1 ingres    . . .   ingres
+-rws--x--x 1 ingres    . . .   printr
+-rws--x--x 1 ingres    . . .   purge
+-rws--x--x 1 ingres    . . .   restore
+.fi
+
+.sh
+EQUEL run time library.
+.PS
+The EQUEL run time library should be
+moved to "/lib/libq.a"
+or "/usr/lib/libq.a". The library
+is needed for compiling user EQUEL
+programs. It is not necessary for
+compiling INGRES itself.
+It is
+preferable although not essential
+that the owner of the library remain "ingres".
+To move the library:
+
+.nf
+       cp .../bin/libq.a  /usr/lib/libq.a
+.fi
+
+Refer to the INGRES Reference Manual for
+information about how to use EQUEL and
+the EQUEL library.
+There is a tutorial on using EQUEL in
+".../doc/other/equeltut.q" and there is a
+small sample program in ".../doc/other/equeldemo.q".
+.sh
+Install concurrency device in kernel
+.PS
+If you want to use concurrency control,
+you will have to install the INGRES concurrency device
+in the kernel.
+This requires adding a device driver,
+an entry in /dev,
+and a one line change to the exit system call.
+You should read the document
+"Instructions for Installing the INGRES
+Concurrency Device in UNIX"
+before proceeding.
+.sh 1
+General Information about INGRES.
+.dn
+Some comments on the INGRES directories
+.PS
+The directories (in ...) necessary
+for a minimal running system are:
+
+.nf
+bin            the binary programs comprising INGRES
+files          files used by various parts of INGRES
+data/base/     user-created databases
+demo           used by the "demodb" command
+.fi
+
+Several additional directories are also created. If space limitations
+are a problem on your system you may want to delete some or all
+of the material here.
+If you need to,
+delete the files but be sure to keep
+the directories.
+The additional directories are:
+
+.nf
+doc            documentation
+lib            object file libraries
+source         system source code
+.fi
+.sh
+Support for separated I & D space.
+.PS
+On a PDP-11,
+you MUST have separated I & D space and floating point hardware
+for INGRES to run under version 7.
+INGRES will NOT run on an 11/40 or similar machine
+under version 7 of UNIX.
+.sh 1
+Getting started using INGRES.
+.dn
+The Users File.
+.PS
+In order to use INGRES a user must be entered into
+the "users" file.
+The users file contains information
+regarding the status and permissions of each
+user.
+This file resembles the /etc/passwd file,
+and includes the user's name, the user
+code (used inside INGRES to identify a user),
+the UNIX id of the user, some status bits,
+and some other fields.
+These are described in detail in the document
+users(files).
+
+The users file can be initialized by running
+the "usersetup" program.
+This program installs all
+users in the /etc/passwd file as valid
+INGRES users.
+The user code is assigned sequentially
+from "aa".
+The status field is initialized to 000000
+for all normal users and
+177777 for the user "ingres".
+
+To setup the users file in /mnt/ingres execute:
+
+       .../bin/usersetup
+
+Once created the users file can be edited using "ed" to do
+the following things:
+
+.in +8
+- completely remove all users not authorized to execute INGRES.
+
+- restrict a user from using a particular database.
+
+- set the other status bits for appropriate users.
+.in -8
+
+As UNIX users are added or deleted, the users
+file must be updated appropriately.
+The usersetup program can be executed only once.
+A diagnostic is issued if it is executed a second time.
+.sh
+Creating a Sample Data Base
+.PS
+The "demodb" command provided can be used to construct the sample
+database on
+which the examples in the tutorial (located on-line in 
+".../doc/other/tutorial") are based.
+In order to execute this command
+you must be entered into the users
+file and have permission to create a database.
+To create the sample
+database and assign it the name "demo"
+type the command:
+
+.nf
+       demodb demo
+.fi
+
+In order to use INGRES
+with this database you need 
+merely type
+
+.nf
+       ingres demo
+.fi
+
+and you will be ready to follow the terminal session described in 
+the tutorial or to formulate your own queries.
+
+To create your own copy of the same sample database
+use some unique database name.
+
+.nf
+       demodb mydemo
+.fi
+
+.sh
+Creating Other Data Bases.
+.PS
+You will no doubt wish to create other databases of your own and
+for this you will need to use "creatdb".
+In order
+to use this command you must be authorized in the users file.
+.sh
+Concurrency Control.
+.PS
+INGRES is designed to run with either no
+concurrency control or with full
+concurrency control.
+INGRES locks portions of a database by using
+a special UNIX device called
+"/dev/lock".
+Initially you can use INGRES without this
+special device.
+If you want concurrency control
+(if more than one person will be using
+INGRES on the same database at the
+same time, you MUST have it) then
+print a copy of the instructions on
+how to install the concurrency device:
+
+.ti +8
+nroff .../doc/other/lockdev.nr
+
+[NOTE: this driver has not yet been converted to run under
+VM/UNIX.]
+.sh 1
+Hints and suggestions.
+.PS
+.dn
+Unix Protection Problems.
+.PS
+If you encounter problems in creating directories or reading in files
+from the tape
+check the protection status of the parent directories involved to make sure
+that permission to write new files exists.
+
+The following summarizes the proper modes for each directory.
+All directories are owned by INGRES except the
+individual databases.
+(The modes in parentheses represent the mode to be used
+if you wish to restrict access maximally.)
+.nf
+
+       bin             755
+       data            700
+       data/base       777
+       demo            755
+       doc             755
+       files           755
+       geoquel and all its subdirectories      755
+       lib             755
+       source and all its subdirectories       755 (700)
+       any database    777 (typically owned by the dba)
+.fi
+
+The programs in .../bin should be in the following modes:
+
+.nf
+       -rwsr----- 1 ingres     . . .   ksort
+       -rwxr-x--x 1 ingres     . . .   monitor
+       -rwsr----- 1 ingres     . . .   vaxingres
+.fi
+
+You may need to
+become super-user to add files
+in "/usr/bin".
+.sh
+Making Certain Programs "Sticky".
+.PS
+The INGRES program to sort relations is
+frequently executed
+during an INGRES session.
+Performance can be improved if it is
+made "sticky".
+If you have sufficient space on your
+swapping device,
+it is advantageous to make the following
+program "sticky".
+This can be done by changing its mode
+to 5700.
+
+       chmod 5740 .../bin/ksort
+
+.sh
+Upper Case Only Terminals
+.PS
+Remember if you are using an upper-case-only terminal you will have
+to use a double backslash "\\\\" with all terminal monitor commands in order to
+override the interpretation of "\\" as an escape character.
+For example on an upper and lower case terminal you would type:
+
+.nf
+       help parts
+       \\g
+.fi
+
+while on an upper case only terminal you would type:
+
+.nf
+       HELP PARTS
+       \\\\G
+.fi
+
+.sh 1
+Source code and system regeneration
+.dn
+Log on as user "ingres".
+.PS
+When doing any system work always log on as "ingres".
+.sh
+Recompilation.
+.PS
+All source code for the system is located in ".../source"
+and various sub-directories therein. Each subdirectory is
+named for a functional component or sub-component of the system.
+Makefiles for regenerating the various portions of the system
+from source are located in the associated directory.
+To regenerate a particular module (e.g. parser) say:
+
+.nf
+       chdir .../source/parser
+       make
+.fi
+
+The entire system can be recompiled and installed
+in /usr/bin
+using the command:
+
+.nf
+       chdir .../source/conf
+       make allinstall sysinstall
+.fi
+
+When recompiling for the first time it is strongly
+advised that you use a hard copy terminal or
+save the output in some other manner.
+
+Libraries of object code are maintained
+in .../lib.
+
+You may find that your C compiler cannot compile INGRES.
+If this is true, you will have to increase the size of
+the symbol table in cpp.
+
+.sh
+Compilation Flags and Funny Flavored UNIXes.
+.PS
+If you are running any system
+other than VM/UNIX release 4 (4BSD),
+you may have to recompile the INGRES system
+before it is usable.
+Examine the file .../source/unix.h closely
+for correspondence with your version of reality.
+Major problems include representation of user and group id's
+and structures returned by various system calls.
+
+Four compile flags in unix.h define the type of user id's
+used on your system.
+For a vanilla version six system
+with 8-bit user id's and 8-bit group id's,
+set the xV6_UNIX compilation flag.
+For a Berkeley version six system
+with a single 16-bit user id
+(and no group id),
+set the xB_UNIX flag.
+For a vanilla version seven system,
+chocolate version six system,
+or VM/UNIX system,
+with 16-bit user id's and 16-bit group id's
+set xV7_UNIX.
+Also, define either
+VAX
+or
+PDP11
+depending on whether you are on a PDP-11 or a VAX.
+
+A large set of flags
+in ingres.h
+control compilation of trace information
+and timing estimates.
+Flags of the form "x?TM"
+(where "?" is a letter as described below)
+turn on timing information.
+THESE SHOULD ALWAYS BE LEFT OFF,
+since the system you receive on the distribution tape
+does not include everything necessary to
+successfully use these flags.
+Flags of the form "x?TR1", "x?TR2", and "x?TR3"
+are trace compilation flags.
+Compiling these in does not automatically
+make trace information print,
+but only makes it available.
+These flags must be properly nested;
+for example, if xMTR2 is set,
+xMTR1 must also be set
+(but xMTR3 is optional).
+The letter codes for these flags are as follows:
+
+.nf
+.in +5
+A      Access Methods
+M      Terminal Monitor
+P      Parser
+Q      Qrymod
+D      Decomposition
+O      One Variable Query Processor
+Z      Data Base Utilities
+E      Equel
+S      Scanner
+T      Standalone Routines
+.fi
+.in -5
+
+A flag named DISTRIB is used in some places
+in the code.
+This is used in the yet-to-be-born
+Distributed INGRES system,
+and should always be left off.
+
+Touching any other defined constants
+should be considered extremely dangerous
+and is done strictly at your own risk.
+
+.sh 1
+Documentation.
+.dn
+Tutorial on INGRES.
+.PS
+A tutorial on using INGRES can be found in
+".../doc/other/tutorial.nr". A copy of the document
+can be produced by:
+
+.nf
+       nroff .../doc/other/tutorial.nr
+.fi
+
+The tutorial guides the reader through
+examples of using QUEL the INGRES database
+language. A basic familiarity with UNIX is
+assumed.
+.sh
+Reference Manual.
+.PS
+The reference manual consists of a number of files - 
+one for each command or feature in INGRES. The reference
+manual can be retrieved by using the
+help command
+(see help(quel)).
+A complete copy of the manual can be
+printed on the line printer by:
+
+       chdir .../doc
+       make ref
+
+The complete manual is about 80 pages.
+
+.sh
+Maintenance Manual.
+.PS
+A guide to using INGRES has been written and is called
+"Creating and Maintaining
+a Database Using INGRES".
+It includes information about
+creating databases, storage structures,
+recovery, copy, indices and
+other useful information.
+A copy of the manual can be produced by:
+
+.nf
+       nroff .../doc/other/maintain.nr
+.fi
+
+.sh
+Design of INGRES
+.PS
+A draft of the report "The Design and Implementation
+of INGRES" by Stonebraker, Kreps and Held can be
+found in ".../doc/other/design.roff". It can be printed
+by:
+
+.nf
+       roff .../doc/other/design.roff
+.fi
+
+The report gives a
+fairly detailed description of the structure
+and capabilities of the entire system as
+it existed over three years ago, in January 1976.
+.ul
+It is out of date in many areas.
+It gives implementation details and
+algorithms of important system modules.
+
+.sh
+Internal Documentation.
+.PS
+We currently do not provide,
+nor have we written any
+internal documentation beyond what
+is mentioned in the "Design and Implementation"
+paper.
+
+This document itself can be reproduced
+by doing:
+
+.nf
+       nroff .../doc/other/howto_setup.nr
+.fi
+
+.sh 1
+Consulting
+.PS
+The INGRES project is not set up to supply
+regular consulting.
+If you do have problems,
+please reread these instructions carefully;
+over two thirds of the "bug reports" we receive
+can be answered by re-reading the documentation.
+For non-technical questions
+(e.g., regarding availability of the system
+or documentation)
+please call the project secretary
+at (415) 642-2344.
+I can also be reached through this number.
+
+
+.in 10
+.nf
+Eric Allman
+Electronics Research Laboratory
+University of California
+Berkeley, California  94720
+.fi
+.in 0
diff --git a/usr/src/ucb/ingres/doc/other/lockdev.nr b/usr/src/ucb/ingres/doc/other/lockdev.nr
new file mode 100644 (file)
index 0000000..90feb30
--- /dev/null
@@ -0,0 +1,317 @@
+.ds HE 'HOW TO INSTALL CONCURRENCY DEVICE''PAGE %'
+.so nmacs
+.ce
+Instructions for installing the INGRES lock device in UNIX
+
+.ce
+December 20, 1977
+.sp 3
+INGRES version 6.1 has a fully implemented concurrency control
+mechanism.
+The INGRES system sets and clears locks by writing to
+a device called "/dev/lock".
+If the device cannot be opened for writing, INGRES
+runs without any concurrency control.
+
+Initially it is advisable to bring up INGRES without
+the concurrency device.
+If planned usage of the INGRES system requires concurrency
+control then the device "/dev/lock" must be installed
+into your UNIX system.
+
+This document describes the procedure for installing
+the UNIX driver for
+"/dev/lock".
+
+.sh 1
+Log in as root.
+.sh 1
+Compiling the concurrency device
+.PS
+.dn
+Copy the source and header files
+.PS
+The concurrency device consists of two
+files: .../source/support/ildr.c
+and .../source/support/ilock.h
+
+Move the source file to /usr/sys/dmr/ildr.c
+and move the header file to /usr/sys/ildr.h
+
+.nf
+       mv .../source/support/ildr.c /usr/sys/dmr/ildr.c
+
+       mv .../source/support/ildr.h /usr/sys/ildr.h
+
+.fi
+.sh
+Installation Parameters
+.PS
+There are several parameters in ildr.h that can be set by
+the user.  These include:
+
+.nf
+       NLOCKS - number of locks
+       PLOCKS - page locks
+       RLOCKS - relation locks
+       DLOCKS - data base locks
+
+.fi
+NLOCKS is the maximum number of locks permissible.
+It determines the size of the lock table.
+PLOCKS is the maximum number of page, relation and data base
+locks.
+RLOCKS is the maximum number of relation and data base locks.
+DLOCKS is the maximum number of data base locks.  Only
+DLOCKS INGRESes can be active at one time.
+
+The following conditions must hold to protect against
+deadlock due to lock table overflow:
+
+.nf
+       NLOCKS > PLOCKS > RLOCKS > DLOCKS + 6
+
+.fi
+The extran number of RLOCKS are required inorder
+to be able to run 6-variable queries.
+We recommend first setting DLOCKS and then setting the other parameters
+as follows:
+
+.nf
+       RLOCKS = 2*DLOCKS + 6
+       PLOCKS = RLOCKS + 3
+       NLOCKS = PLOCKS + 1
+.fi
+
+For example, to reduce the size of the lock table, one could set
+DLOCKS = 2, RLOCKS = 10, PLOCKS = 13, NLOCKS = 14.
+In this case, only 2 people could be running ingres at one time.
+
+As another example, to allow for more concurrent INGRESes, one could set
+DLOCKS = 20, RLOCKS = 46, PLOCKS = 49, NLOCKS = 50.
+This scenario would allow for twenty simultaneous INGRES users.
+
+The memory required by the lockdriver is 
+1008 bytes in the text segment and
+36 + 18 * NLOCKS in the data and BSS segments.
+
+.sh
+Change directory
+.PS
+Change directory to where the device drivers
+are kept on your system.
+
+.nf
+       chdir /usr/sys/dmr
+
+.fi
+.sh
+Compile and update the UNIX library
+.PS
+UNIX object code
+is divided
+into two libraries, lib1 (the system code)
+and lib2 (the device drivers).
+Compile ildr.c and put it in lib2
+
+.nf
+       cc -c -O ildr.c
+       ar rv ../lib2 ildr.o
+.fi
+.sh 1
+Installing device into the UNIX file system.
+.PS
+To install a device into the UNIX system,
+the configuration file must be changed.
+.dn
+Edit /usr/sys/conf/conf.c ( or c.c )
+.PS
+Edit the configuration file and add the lock
+device to the character device list.
+On some systems the configuration file
+is called conf.c and on others it is
+called c.c.
+Find the last device under the "cdevsw[]"
+table and add the line:
+
+.nf
+       &nulldev,  &nulldev,  &nulldev,  &ilwrite,  &nodev,
+
+.fi
+The row number for the device become the major device number.
+.ul
+Remember to count starting at zero.
+.sh
+Recompile conf.c (or c.c)
+.PS
+Recompile the configuration file.
+
+.ti +8
+chdir /usr/sys/conf
+.ti +8
+cc -c conf.c
+.sh 1
+Updating the system exit() routine.
+.PS
+.dn
+Editing /usr/sys/ken/sys1.c
+.PS
+The system exit call should be changed to call the
+concurrency device.
+This is needed in cases when INGRES dies
+abnormally,
+for example when the process is killed or
+when a system error occures.
+The call "ilrma(q->p_pid)" should be added to
+exit() in /usr/sys/ken/sys1.c
+before the label "loop".
+The exit code will then look like:
+
+.nf
+exit()
+{
+       register int *q, a;
+       register struct proc *p;
+
+       p = u.u_procp;
+       p->p_flag =& ~STRC;
+       p->p_clktim = 0;
+       for(q = &u.u_signal[0]; q < &u.u_signal[NSIG];)
+               *q++ = 1;
+       for(q = &u.u_ofile[0]; q < &u.u_ofile[NOFILE]; q++)
+               if(a = *q) {
+                       *q = NULL;
+                       closef(a);
+               }
+       iput(u.u_cdir);
+       xfree();
+       a = malloc(swapmap, 1);
+       if(a == NULL)
+               panic("out of swap");
+       p = getblk(swapdev, a);
+       bcopy(&u, p->b_addr, 256);
+       bwrite(p);
+       q = u.u_procp;
+       mfree(coremap, q->p_size, q->p_addr);
+       q->p_addr = a;
+       q->p_stat = SZOMB;
+       /*
+        * remove outstanding ingres locks for
+        * the dying process
+        */
+       ilrma(q->p_pid);
+
+loop:
+       for(p = &proc[0]; p < &proc[NPROC]; p++)
+       if(q->p_ppid == p->p_pid) {
+               wakeup(&proc[1]);
+               wakeup(p);
+               for(p = &proc[0]; p < &proc[NPROC]; p++)
+               if(q->p_pid == p->p_ppid) {
+                       p->p_ppid  = 1;
+                       if (p->p_stat == SSTOP)
+                               setrun(p);
+               }
+               swtch();
+               /* no return */
+       }
+       q->p_ppid = 1;
+       goto loop;
+}
+.fi
+
+.sh
+Updating /usr/sys/lib1
+.PS
+Now recompile sys1.c and update lib1:
+
+.nf
+       chdir /usr/sys/ken
+       cc -c -O sys1.c
+       ar rv ../lib1 sys1.o
+
+.fi
+.sh 1
+Reloading UNIX
+.PS
+.dn
+Reloading the system
+.PS
+The UNIX system is now ready to be reloaded.
+Follow the procedures for your particular
+installation.
+Make sure the files:
+
+.nf
+low.o
+m45.o ( or m40.o)
+conf.o (or c.o)
+
+.fi
+are all present or that the load procedure compiles them.
+On the Berkeley 11/70 system the shell file to
+do this is /usr/sys/ld:
+.nf
+
+       chdir /usr/sys
+       sh ld 70
+
+.fi
+.sh
+Preparing to Reboot.
+.PS
+You are no ready to move the new unix into
+/unix.
+Since the namelist has changed,
+you should be running single user
+before doing this.
+.sh
+Rebooting UNIX
+.PS
+Move the new UNIX to the directory
+where it is normally booted from:
+
+.nf
+       mv /usr/sys/a.out /unix
+.fi
+
+Now reboot the system by giving a sync command,
+and restarting according to your normal boot
+procedures.
+
+.sh 1
+Add device to /dev
+.PS
+.dn
+Creating the node.
+.PS
+The concurrency device must be put in "/dev"
+after unix has been rebooted.
+Execute the command:
+
+.nf
+       /etc/mknod  /dev/lock  c  major  0
+
+.fi
+where "major" is the major device number.
+Once again, the major device number is the
+position of the device in the "cdevsw[]" table.
+Remember to start counting from zero.
+.sh
+Change the mode.
+.PS
+Now change the mode of the device to be writable by
+owner and owned by INGRES:
+
+.nf
+       chown ingres /dev/lock
+       chmod 200 /dev/lock
+.fi
+.sh 1
+Done.
+.PS
+INGRES will now use the /dev/lock device for its
+concurrency control.
+A simple way to verify this is to try running
+(for example) "purge" on a data base while
+anyone is running "ingres" on the same data base.
diff --git a/usr/src/ucb/ingres/doc/other/nmacs b/usr/src/ucb/ingres/doc/other/nmacs
new file mode 100644 (file)
index 0000000..3f0dd50
--- /dev/null
@@ -0,0 +1,65 @@
+.de sh                 *** section heading
+.if \\n(.$ .@d \\$1
+.ds @@ #\\n(#0
+.nr \\*(@@ +1
+.ds @n \\n(#1
+.if \\n(#2 .as @n .\\n(#2
+.if \\n(#3 .as @n .\\n(#3
+.if \\n(#4 .as @n .\\n(#4
+.if \\n(#5 .as @n .\\n(#5
+.if \\n(#6 .as @n .\\n(#6
+.if !\\n(#0 .in 0
+.if \\n(#0 .@p
+..
+.de @d                 change section depth
+.nr #0 \\$1
+.if \\n(#0 .if !\\n(#1 .nr #1 0
+.if !\\n(#0 .nr #1 0
+.if \\n(#0-1 .if !\\n(#2 .nr #2 0
+.if !\\n(#0-1 .nr #2 0
+.if \\n(#0-2 .if !\\n(#3 .nr #3 0
+.if !\\n(#0-2 .nr #3 0
+.if \\n(#0-3 .if !\\n(#4 .nr #4 0
+.if !\\n(#0-3 .nr #4 0
+.if \\n(#0-4 .if !\\n(#5 .nr #5 0
+.if !\\n(#0-4 .nr #5 0
+.if \\n(#0-5 .if !\\n(#6 .nr #6 0
+.if !\\n(#0-5 .nr #6 0
+..
+.de @p                 print section heading
+.in \\n(#i*\\n(#0u
+.sp
+.ti -\\n(#i
+\\*(@n\&.\ \ \c
+..
+.de up                 *** move up heading number (2.1.1 -> 2.2)
+.sh -1
+..
+.de ux                 *** heading up, no increment (2.1.1 -> 2.1)
+.nr _9 \\n(#0-1
+.if \\n(.$ .nr _9 +1
+.if \\n(.$ .nr _9 \\$1
+.@d \\n(_9
+.in \\n(#i*\\n(#0u
+..
+.de dn                 *** move down heading number (2.1.1 -> 2.1.1.1)
+.sh +1
+..
+.de gs                 *** get section number
+.ds ,\\$1 \\*(@n
+..
+.nr #i 4
+.de PS                 *** space after a section title
+.sp 1
+..
+.po 5
+.de @h
+'sp 3
+'tl \\*(HE
+'sp 2
+..
+.de @f
+'bp
+..
+.wh 0 @h
+.wh -6 @f
diff --git a/usr/src/ucb/ingres/doc/other/setup_geo.nr b/usr/src/ucb/ingres/doc/other/setup_geo.nr
new file mode 100644 (file)
index 0000000..2c33277
--- /dev/null
@@ -0,0 +1,214 @@
+.ds II \s-2INGRES\s0
+.ds GQ \s-2GEO-QUEL\s0
+.ds HE 'HOW TO SET UP GEO-QUEL''PAGE %'
+.so nmacs
+.ce
+Instructions for setting up GEO-QUEL version 6.2.
+
+.ce
+(March 22, 1979)
+
+This set of instructions will help you to get
+\*(GQ running on your \*(II system.
+If you have been running version 4.0 of \*(GQ
+you should be aware of some differences
+between the old and current versions.
+They are identified in section 6 of this document.
+Your \*(II system should have been completely
+installed before starting to install \*(GQ.
+
+
+.sh 1
+Moving \*(GQ to /usr/bin.
+.PS
+The binary for \*(GQ is in .../bin/geoquel.
+It should be moved or linked into /usr/bin.
+This will provide you with a working system.
+
+Move \*(GQ to /usr/bin:
+
+.ti +8
+mv .../bin/geoquel  /usr/bin/geoquel
+
+Verify that the file mode of \*(GQ is 711.
+Notice that it SHOULD NOT set user id.
+The correct mode is:
+
+.ti +8
+-rwx--x--x 1 ingres    . . .   geoquel
+.sh 1
+\*(GQ documentation.
+.PS
+The reference manual for \*(GQ may be found
+in .../doc/geoquel.
+To print a copy of the \*(GQ reference manual
+on the line printer,
+execute the command:
+
+.ti +8
+setup georef | lpr
+
+These instructions can be printed using the command:
+
+.ti +8
+nroff .../doc/other/setup_geo.nr
+
+Documentation for the graphic terminal support
+software, GRAFPAC, is currently limited to the information
+in the code.
+The files in .../geoquel/grafpac are organized such that a
+file names start with a descriptive two letter code.
+The codes are:
+
+.in +8
+.nf
+gt     GT40-GT42 specific routines
+tk     Tektronix 4014 specific routines
+tv     Device independent routines
+.fi
+.in -8
+
+GRAFPAC has been organized so that the
+proceedure level interface is machine independent.
+
+.sh 1
+Display Terminal Support
+.PS
+\*(GQ supports two types of display
+terminals: Digital Equipment Corporation's
+GT40-GT42, and Tektronix's 4014.
+The Tektronix 4014 version can be used to
+drive any 4010 type terminal but a
+4014 with extended graphics module is expected.
+
+When running \*(GQ in background or from a
+terminal that cannot display graphic output,
+it must guess which type of display list should
+be drawn, GT40-GT42 or 4014 type.
+The default has been set to
+4014.
+If you would prefer another
+default the file .../geoquel/geoquel.c
+must be changed.
+Specifically, the three compile options
+at the head of the file must be adjusted.
+See the comment in the code for further
+information.
+
+To use a GT40 or GT42, you must load a monitor program
+in the PDP-11.
+This monitor can be found in .../geoquel/gt42.
+A loaded copy of the monitor is supplied
+in .../geoquel/gt42/gt42mon and can be used directly.
+Simply 'cat' this file to the terminal.
+
+.ti +10
+cat .../geoquel/gt42/gt42mon
+
+The format of this file is suitable for use with
+the standard ROM loader normally at address 166000.
+
+If you decide to provide support for
+another graphic device, you must re-write
+the routines in .../geoquel/grafpac.
+Naturally, we would be interested in hearing
+about any other devices you develop support for.
+
+.sh 1
+Possible source code changes.
+.dn
+If your machine has a hardware floating point unit.
+.PS
+You may wish to recompile \*(GQ without the
+software floating point interpreter.
+This will not affect the operation in any way
+(since the software interpreter
+will not be used if your
+machine has floating point hardware).
+The resulting copies of the object code will be
+somewhat smaller.
+There are various shell files which contain
+C-compile statements.
+On each of these
+the "-f" flag must be removed.
+The shell files are all located in the directory .../geoquel/setup.
+The one exception is .../setup/geoquel.sh.
+
+.in +8
+ed .../setup/geoquel.sh
+.ti +5
+(find "-f" on cc statement and remove)
+.br
+chdir .../geoquel/setup
+.ti +5
+(examine all files and remove -f's)
+.in -8
+
+.sh
+Recompilation.
+.PS
+To recompile \*(GQ, execute the command:
+
+       setup geoquel
+
+This command will recompile \*(GQ from the
+source code.
+Various messages will be printed on the terminal telling
+you what is being done and where it is.
+The resulting copy of \*(GQ will be placed in .../bin/geoquel.
+It should be moved to /usr/bin/geoquel.
+
+.sh 1
+Setting up the ttytype file.
+.PS
+If you have been using version 4.0 of \*(GQ,
+you will not need to do this step.
+
+The ttytype file describes
+each terminal on your system.
+\*(GQ will
+not attempt to display graphical output on terminals
+that are not capable of displaying it.
+There is a sample of the file in
+
+.ti +8
+".../geoquel/ttytype.sample".
+
+This is a copy of the file in use on the Berkeley system.
+
+The ttytype file consists of a series of
+lines;
+the first character is the terminal id,
+and the rest of the line tells
+the type of the terminal.
+The first of these characters is a terminal class,
+and the rest signify the brand, or some other more
+descriptive indication.
+A completely blank line terminates the useful part
+of the file, after which comments may 
+appear unrestricted.
+In the sample file the currently recognized
+(defined) terminal types are listed.
+
+Edit the sample file or create a new one to
+match your system.
+Place the file in .../files/ttytype:
+
+.ti +8
+mv .../geoquel/ttytype.sample  .../files/ttytype
+
+.sh 1
+Previous versions of \*(GQ.
+.PS
+The large change in version number (4.0 to 6.2)
+was done so that \*(GQ matches the \*(II version numbering.
+
+There has been very few external changes to the
+\*(GQ language.
+The HISTOGRAM command was greatly improved and the documentation
+cleaned up.
+In later modifications of \*(GQ there will be
+some additional monitor commands and the underlying
+graphics package will be updated.
+Also, a rudimentary facility for accessing the \*(II
+HELP and PRINT commands was added.
diff --git a/usr/src/ucb/ingres/doc/other/tutorial.nr b/usr/src/ucb/ingres/doc/other/tutorial.nr
new file mode 100644 (file)
index 0000000..c77e05a
--- /dev/null
@@ -0,0 +1,1995 @@
+.de @h
+'sp 4
+'tl '\a'''
+'sp 2
+.ns
+..
+.wh 0 @h
+.po 5
+.rs
+\a
+.sp 4
+.ce
+A TUTORIAL ON INGRES
+.sp 15
+.ce
+by
+.ce
+Robert Epstein
+.sp 18
+.ce 3
+Memorandum No. ERL - M77-25
+December 15, 1977
+(Revised)
+.sp 3
+.ce 4
+Electronics Research Laboratory
+College of Engineering
+University of California, Berkeley
+94720
+.bp 1
+.de @f
+'sp 3
+'tl 'A Tutorial on INGRES''Page %'
+'bp
+..
+.wh -7 @f
+.rs
+.ce 1
+A Tutorial on INGRES
+.sp 5
+This tutorial describes how to use the INGRES data base
+management system.
+You should be able to follow the the examples
+given here and observe the same results.
+
+The data manipulation language supported by the
+INGRES system is called
+QUEL (QUEry Language).
+Complete information on QUEL and INGRES appears
+in the INGRES reference manual.
+This tutorial does not attempt to
+cover every detail of INGRES.
+
+Begin by logging onto UNIX, the
+time sharing system under which INGRES runs.
+If at all possible, use a terminal
+that has both upper and lower case letters;
+otherwise life is going to be miserable for you.
+If you are on an upper case only terminal,
+type "\\\\" everywhere "\\" appears in the
+tutorial.
+
+There should currently be a "%" printed on your terminal.
+To start using INGRES type the command:
+.nf
+
+% ingres demo
+
+.fi
+This requests "UNIX" to invoke INGRES using the
+data base called "demo".
+After a few seconds, the following will appear:
+.nf
+
+INGRES version 6.1/0 login
+Tue Aug 30 14:52:23 1977
+
+COPYRIGHT
+The Regents of the University of California
+1977
+
+This program material is the property of the
+Regents of the University of California and
+may not be reproduced or disclosed without
+the prior written permission of the owner.
+
+\ago
+*
+
+.fi
+The first two lines include the INGRES version
+number (in this case version 6.1) and the current date.
+Following that is the "dayfile",
+which includes
+messages related to the
+INGRES system.
+The "go" indicates that INGRES
+is ready for your interactions.
+
+The INGRES monitor
+prints an asterisk ("*") at the beginning of
+each line
+to remind you that INGRES is waiting for input.
+
+Type the command:
+.nf
+
+* print parts
+* \\g
+Executing . . .
+
+.fi
+The line "print parts" requests a printout of
+some data stored in the data base.
+The "\\g" means "go".
+The message "Executing . . ."
+indicates that INGRES is processing your
+query.
+The following then appears:
+.nf
+
+parts relation
+
+|pnum  |pname               |color   |weight|qoh   |
+|--------------------------------------------------|
+|     1|central processor   |pink    |    10|     1|
+|     2|memory              |gray    |    20|    32|
+|     3|disk drive          |black   |   685|     2|
+|     4|tape drive          |black   |   450|     4|
+|     5|tapes               |gray    |     1|   250|
+|     6|line printer        |yellow  |   578|     3|
+|     7|l-p paper           |white   |    15|    95|
+|     8|terminals           |blue    |    19|    15|
+|    13|paper tape reader   |black   |   107|     0|
+|    14|paper tape punch    |black   |   147|     0|
+|     9|terminal paper      |white   |     2|   350|
+|    10|byte-soap           |clear   |     0|   143|
+|    11|card reader         |gray    |   327|     0|
+|    12|card punch          |gray    |   427|     0|
+|--------------------------------------------------|
+\a
+continue
+*
+
+.fi
+What is printed on your terminal is the "parts relation".
+Intuitively, a relation is nothing more that a
+table with rows and columns.
+
+In this case the relation name is "parts".
+There are five columns (we call them domains)
+named pnum (part number), pname (part name),
+color, weight, qoh (quantity on hand).
+Each row of the relation (called a tuple)
+represents one entry, which in this
+case represents one part in a computer
+installation.
+A relation can have up to 49 domains and a
+virtually unlimited number of tuples.
+
+Notice that after the query is executed, INGRES prints
+"continue", while when we first entered INGRES
+it printed "go".
+As you enter a query INGRES
+saves what you type in
+a "workspace".
+If you
+ever mistype a query, typing "\\r"
+will "reset" (ie. erase) your workspace.
+(Later on we will
+learn ways to edit mistakes so
+we don't have to retype the entire query.)
+
+At any time you can see what is in the
+workspace by typing "\\p".
+Try typing "\\p":
+
+.nf
+* \\p
+print parts
+*
+
+.fi
+The current contents of the workspace
+is printed.
+Now try typing "\\r":
+
+.nf
+* \\r
+go
+*
+
+.fi
+The workspace is now empty.
+Whenever
+INGRES types "continue" the
+workspace is non-empty;
+whenever INGRES types "go" the
+workspace is empty.
+
+After a query is executed,
+INGRES typically types "continue".
+If you then type a new query, INGRES
+automatically erases the previous query,
+so you don't have to type "\\r" after every query.
+This will be further explained as we proceed.
+
+Using the "retrieve" command we can write
+specific queries about relations.
+As an example, let's have INGRES
+print only the "pname" domain of the parts
+relation.
+Type the command:
+.nf
+
+* range of p is parts
+* retrieve (p.pname)
+* \\g
+Executing . . .
+
+
+|pname               |
+|--------------------|
+|central processor   |
+|memory              |
+|disk drive          |
+|tape drive          |
+|tapes               |
+|line printer        |
+|l-p paper           |
+|terminals           |
+|paper tape reader   |
+|paper tape punch    |
+|terminal paper      |
+|byte-soap           |
+|card reader         |
+|card punch          |
+|--------------------|
+\a
+continue
+*
+
+.fi
+The output is just the pname domain from the
+parts relation.
+What we did required two steps.
+First we declared what is called a "tuple variable"
+and assigned it to range over the parts relation.
+
+range of p is parts
+
+What this means in English is that the letter "p"
+represents the parts relation.
+It may be thought of as a marker
+which moves down the "parts" relation to
+keep our place.
+INGRES remembers the association so that
+once p is declared to range over parts,
+we don't have to repeat the range declaration.
+This is useful when we are working
+with more than one relation, as will be seen later on.
+
+Next we used the retrieve command.
+Its form is
+
+retrieve ( list here what you want retrieved )
+
+"p" by itself refers to the parts relation.
+"p.pname" refers to the pname domain of the
+parts relation, so saying:
+
+retrieve (p.pname)
+
+means retrieve the
+pname domain of the parts relation.
+
+Try the
+query to retrieve pname and color:
+
+.nf
+* retrieve p.pname, p.color
+* \\g
+Executing . . .
+
+2500: syntax error on line 1
+last symbol read was: .
+
+continue
+*
+
+.fi
+Unfortunately we've made an error.
+INGRES tells us that it found a syntax
+error on the first line of the query.
+"Syntax error" means that we have
+typed something which INGRES cannot recognize.
+The error occured on line 1.
+INGRES makes a sometimes helpful and
+sometimes feeble attempt at
+diagnosing the problem.
+Whenever possible,
+INGRES tells us the last thing it read before it got confused.
+
+In this case, the error is that the list of things to be retrieved
+(called the target list) must be enclosed in parenthesis.
+The correct query is:
+.nf
+
+* retrieve (p.pname, p.color)
+* \\g
+Executing . . .
+
+
+|pname               |color   |
+|-----------------------------|
+|central processor   |pink    |
+|memory              |gray    |
+|disk drive          |black   |
+|tape drive          |black   |
+|tapes               |gray    |
+|line printer        |yellow  |
+|l-p paper           |white   |
+|terminals           |blue    |
+|paper tape reader   |black   |
+|paper tape punch    |black   |
+|terminal paper      |white   |
+|byte-soap           |clear   |
+|card reader         |gray    |
+|card punch          |gray    |
+|-----------------------------|
+\a
+continue
+*
+
+.fi
+You can restrict which tuples are printed by adding
+a "qualification" to the query.
+For example to get the name and color of
+only those parts which are gray, type:
+.nf
+
+* retrieve (p.pname, p.color)
+* where p.color = "gray"
+* \\g
+Executing . . .
+
+
+|pname               |color   |
+|-----------------------------|
+|memory              |gray    |
+|tapes               |gray    |
+|card reader         |gray    |
+|card punch          |gray    |
+|-----------------------------|
+\a
+continue
+*
+
+.fi
+Notice that INGRES prints only those parts where p.color
+is gray.
+Notice also that gray must be in quotes ("gray").
+This is necessary.
+The only way INGRES will recognize character strings
+(e.g. words) is to enclose them in quotes.
+
+What if we wanted part names for gray or pink parts?
+We only need to append to the previous
+query the phrase:
+
+or p.color = "pink"
+
+Remember, however, that if the next
+line typed begins a new query, INGRES
+will automatically reset the workspace.
+The workspace will be
+.ul 
+saved
+only if the next line begins with a command
+such as "\\p" or "\\g".
+(There are others which we will come to later.)  
+If such a command is typed,
+the previous query is saved and anything
+further will be appended to that query.
+
+Thus, by typing:
+.nf
+
+* \\p
+retrieve (p.pname, p.color)
+where p.color = "gray"
+*
+
+.fi
+you can see the previous query.
+Now type:
+.nf
+
+* or p.color = "pink"
+*
+
+.fi
+INGRES appends that last line to
+the end of the query.
+You can verify this yourself by printing the workspace:
+.nf
+
+* \\p
+retrieve (p.pname, p.color)
+where p.color = "gray"
+or p.color = "pink"
+*
+
+.fi
+Now run the query:
+.nf
+
+* \\g
+Executing . . .
+
+
+|pname               |color   |
+|-----------------------------|
+|central processor   |pink    |
+|memory              |gray    |
+|tapes               |gray    |
+|card reader         |gray    |
+|card punch          |gray    |
+|-----------------------------|
+\a
+continue
+*
+
+.fi
+The rules about when the workspace is reset may be
+very confusing at first.
+In general, INGRES will do exactly what
+you want without you having to think about it.
+
+We have seen qualifications which used "or" and "=".
+In general one can use:
+
+.nf
+       and
+       or
+       not
+       =       (equal)
+       !=      (not equal)
+       >       (greater than)
+       >=      (greater than or equal)
+       <       (less than)
+       <=      (less than or equal)
+.fi
+
+Evaluation occurs in the
+order the qualification was typed (ie. left to right).
+Parenthesis can be used to group things
+in any arbitrary order.
+
+INGRES can do computations on the data
+stored in a relation.
+For example, the parts relation has
+quantity on hand and weight for each item.
+We might like to know the total weight
+for each group of parts (i.e. weight multiplied by qoh).
+
+To get the name, part number and total weight
+for each part type the query:
+.nf
+
+* retrieve (p.pname, p.pnum, p.qoh * p.weight)
+* \\g
+Executing . . .
+
+2500: syntax error on line 1
+last symbol read was: *
+\a
+continue
+*
+
+.fi
+Another error.
+The problem is that when a computation
+is done, INGRES does not know how to
+title the domain on the printout.
+For a simple domain, INGRES uses the
+domain name as a title.
+For anything else, you must
+create a new domain title by specifying:
+.nf
+
+       tot = p.qoh * p.weight
+
+.fi
+More generally the form is:
+.nf
+
+       title = expression
+
+.fi
+For example:
+.nf
+
+       name = p.pname
+       computation = p.weight / 2000 * (p.qoh + 2)
+
+.fi
+Let's fix the error by retyping
+the query.
+As long as the first line after a query
+does not begin with a "\\p" or "\\g" then
+INGRES will automatically reset
+the workspace, erasing the previous
+query for us.
+.nf
+
+* retrieve (p.pname, p.pnum, tot=p.qoh * p.weight)
+* \\g
+Executing . . .
+
+
+|pname               |pnum  |tot   |
+|----------------------------------|
+|central processor   |     1|    10|
+|memory              |     2|   640|
+|disk drive          |     3|  1370|
+|tape drive          |     4|  1800|
+|tapes               |     5|   250|
+|line printer        |     6|  1734|
+|l-p paper           |     7|  1425|
+|terminals           |     8|   285|
+|paper tape reader   |    13|     0|
+|paper tape punch    |    14|     0|
+|terminal paper      |     9|   700|
+|byte-soap           |    10|     0|
+|card reader         |    11|     0|
+|card punch          |    12|     0|
+|----------------------------------|
+\a
+continue
+*
+
+.fi
+In addition to multiplication, INGRES supports:
+.in +8
+
++   addition
+.br
+-   subtraction (and unary negation)
+.br
+/   division
+.br
+*   multiplication
+.br
+**  exponentiation (e.g. 3**10)
+.br
+abs  absolute value (e.g. abs(p.qoh - 50) )
+.br
+mod  modulo division
+.br
+
+.in -8
+and many others.
+Please refer to the INGRES reference manual for
+a brief but complete description of
+what is supported.
+
+If all we wanted were part numbers 2 or 10,
+then we could add the qualification:
+
+       where p.pnum = 2 or p.pnum = 10
+
+CAUTION: if we just started typing "where p.pnum .... "
+INGRES would understand this as the
+beginning of a new query
+and would reset the workspace.
+To avoid this you could type "\\p" and force INGRES
+to print the workspace,
+or you can type "\\a" (append).
+The append command guarantees that whatever
+else is typed will be appended to
+what is already in the workspace.
+This command is only needed immediately after
+a query is executed.
+Any other time data will be appended automatically.
+Try the following:
+.nf
+
+* \\a
+* where p.pnum = 2 or p.pnum = 10
+* \\g
+Executing . . .
+
+
+|pname               |pnum  |tot   |
+|----------------------------------|
+|memory              |     2|   640|
+|byte-soap           |    10|     0|
+|----------------------------------|
+\a
+continue
+*
+
+.fi
+To include all part numbers greater than 2 and less than or
+equal to 10:
+.nf
+
+* retrieve (p.pname, p.pnum, tot=p.qoh * p.weight)
+* where p.pnum > 2 and p.pnum <= 10
+* \\g
+Executing . . .
+
+
+|pname               |pnum  |tot   |
+|----------------------------------|
+|disk drive          |     3|  1370|
+|tape drive          |     4|  1800|
+|tapes               |     5|   250|
+|line printer        |     6|  1734|
+|l-p paper           |     7|  1425|
+|terminals           |     8|   285|
+|terminal paper      |     9|   700|
+|byte-soap           |    10|     0|
+|----------------------------------|
+\a
+continue
+*
+
+.fi
+Now, suppose we want to change
+the previous query to give results
+for part numbers between 5 and 10
+instead of 2 and 10.
+You are probably annoyed at having to retype
+the entire query in order to
+change one character.
+Consequently,
+INGRES lets you use the UNIX text editor
+to make corrections and/or additions
+to your workspace.
+At any time you can type "\\e" and the
+INGRES monitor will write your workspace to a file
+and call the UNIX "ed" program.
+For example:
+.nf
+
+* \\e
+>>ed
+83
+
+.fi
+The ">>ed" message tells you that you are now using the
+editor.
+The number 83 is the number of characters in your workspace.
+
+We can now edit the query by changing the
+2 to a 5.
+Included in the UNIX documentation is a tutorial on using the
+text editor.
+Rather than duplicating that tutorial, we will just
+use a few of the editor commands to illustrate how
+to do editing:
+.nf
+
+1p
+retrieve (p.pname,p.pnum,tot = p.qoh * p.weight)
+2p
+where p.pnum > 2 and p.pnum <= 10
+s/2/5/p
+where p.pnum > 5 and p.pnum <= 10
+w
+83
+q
+<<monitor
+*
+
+.fi
+Very briefly, this is what happens.
+"1p" and "2p" printed lines 1 and 2.
+"s/2/5/p" substitutes a 5 for a 2 on the current
+line (line 2), and then prints that line.
+"w" writes the query back to the INGRES workspace.
+
+Inside the editor you can use any "ed" command
+except "e" (since e changes the file name).
+When you quit the editor (q command),
+the INGRES monitor will print "<<monitor" to
+remind you that you are back in INGRES.
+Notice that you MUST precede the "q" command with
+a "w" command
+to pass the
+corrected workspace back to INGRES.
+
+To verify that the query is correct and to run it, type:
+.nf
+* \\p\\g
+retrieve (p.pname,p.pnum,tot = p.qoh * p.weight)
+where p.pnum > 5 and p.pnum <= 10
+Executing . . .
+
+
+|pname               |pnum  |tot   |
+|----------------------------------|
+|line printer        |     6|  1734|
+|l-p paper           |     7|  1425|
+|terminals           |     8|   285|
+|terminal paper      |     9|   700|
+|byte-soap           |    10|     0|
+|----------------------------------|
+\a
+continue
+*
+
+.fi
+
+Having exhausted the
+interesting queries concerning the parts relation, lets now
+look at a new relation called "supply".
+Type:
+.nf
+
+* print supply
+* \\g
+Executing . . .
+
+
+supply relation
+
+|snum  |pnum  |jnum  |shipdate|quan  |
+|------------------------------------|
+|   475|     1|  1001|73-12-31|     1|
+|   475|     2|  1002|74-05-31|    32|
+|   475|     3|  1001|73-12-31|     2|
+|   475|     4|  1002|74-05-31|     1|
+|   122|     7|  1003|75-02-01|   144|
+|   122|     7|  1004|75-02-01|    48|
+|   122|     9|  1004|75-02-01|   144|
+|   440|     6|  1001|74-10-10|     2|
+|   241|     4|  1001|73-12-31|     1|
+|    62|     3|  1002|74-06-18|     3|
+|   475|     2|  1001|73-12-31|    32|
+|   475|     1|  1002|74-07-01|     1|
+|     5|     4|  1003|74-11-15|     3|
+|     5|     4|  1004|75-01-22|     6|
+|    20|     5|  1001|75-01-10|    20|
+|    20|     5|  1002|75-01-10|    75|
+|   241|     1|  1005|75-06-01|     1|
+|   241|     2|  1005|75-06-01|    32|
+|   241|     3|  1005|75-06-01|     1|
+|    67|     4|  1005|75-07-01|     1|
+|   999|    10|  1006|76-01-01|   144|
+|   241|     8|  1005|75-07-01|     1|
+|   241|     9|  1005|75-07-01|   144|
+|------------------------------------|
+\a
+continue
+*
+
+.fi
+The supply relation contains snum (the supplier number),
+pnum (the part number which is supplied by that supplier),
+jnum (the job number),
+shipdate (the date it was shipped),
+and quan (the quantity shipped).
+
+To find out what parts are supplied by supplier number 122 type:
+.nf
+
+* retrieve (s.pnum) where s.snum = 122
+* \\g
+Executing . . .
+
+2109: line 1, Variable 's' not declared in RANGE statement
+\a
+continue
+*
+
+.fi
+We have referenced the tuple variable "s"
+(i.e. s.pnum) without telling INGRES what
+"s" represents.
+We are missing a range declaration.
+Retype the query as follows:
+.nf
+
+* range of s is supply
+* retrieve (s.pnum) where s.snum = 122
+* \\g
+Executing . . .
+
+
+|pnum  |
+|------|
+|     7|
+|     7|
+|     9|
+|------|
+\a
+continue
+*
+
+.fi
+Supplier number 122 supplies part numbers 7, 7 and 9.
+Note that 7 is listed twice.
+When retrieving tuples onto a terminal it is
+more efficient for INGRES NOT to check for duplicate
+tuples.
+INGRES can be forced to remove duplicate tuples.
+We will come to that later.
+
+We now know that supplier 122 supplies
+part numbers 7 and 9.
+If you haven't run this query a few hundred
+times you probably don't know what part
+names correspond to part numbers 7 and 9.
+We could find out simply by
+running the query:
+.nf
+
+* retrieve (p.pname) where p.pnum = 7 or
+* p.pnum = 9
+* \\g
+Executing . . .
+
+
+|pname               |
+|--------------------|
+|l-p paper           |
+|terminal paper      |
+|--------------------|
+\a
+continue
+*
+
+.fi
+After two queries we know by part name
+what parts are supplied by supplier number 122.
+We could do the same thing in one query by asking:
+.nf
+
+* retrieve (p.pname) where p.pnum = s.pnum
+* and s.snum = 122
+* \\g
+Executing . . .
+
+
+|pname               |
+|--------------------|
+|l-p paper           |
+|l-p paper           |
+|terminal paper      |
+|--------------------|
+\a
+continue
+*
+
+.fi
+Again note that "l-p paper" is duplicated.
+Look closely at this query.
+Note that the domain pnum exists in both
+the parts and supply relations.
+By saying p.pnum = s.pnum, we are logically
+joining the two relations.
+
+Suppose we wished to find all suppliers who supply
+the central processor.
+We know that we will want to retrieve s.snum.
+We want only those s.snum's where the corresponding s.pnum
+is equal to the part number for the central
+processor.
+
+If we find the p.pname which is equal to "central processor"
+then that will tell us the correct p.pnum.
+Finally we want s.pnum = p.pnum.
+The query is:
+.nf
+
+* retrieve (s.snum) where
+* s.pnum = p.pnum and p.pname = "central processor"
+* \\g
+Executing . . .
+
+
+|snum  |
+|------|
+|   475|
+|   475|
+|   241|
+|------|
+\a
+continue
+*
+
+.fi
+Let's abandon the parts and supply relations and try another.
+First, we can see what other relations are in the
+database by typing:
+.nf
+
+* help \\g
+* Executing . . .
+
+
+ relation name     relation owner
+
+ relation          ingres
+ attribute         ingres
+ indexes           ingres
+ integrity         ingres
+ constraint        ingres
+ item              ingres
+ sale              ingres
+ employee          ingres
+ dept              ingres
+ supplier          ingres
+ store             ingres
+ parts             ingres
+ supply            ingres
+
+\a
+continue
+* 
+
+.fi
+Let's look at the "employee" relation.
+Since we know nothing about the relation we
+can also use the "help" command to learn about it.
+Type:
+.nf
+
+* help employee
+* \\g
+Executing . . .
+
+
+Relation:              employee
+Owner:                 ingres
+Tuple width:           30
+Saved until:           Fri Mar 25 11:01:30 1977
+Number of tuples:      24
+Storage structure:     paged heap
+relation type:         user relation
+
+ attribute name    type  length  keyno.
+
+ number            i       2
+ name              c      20
+ salary            i       2
+ manager           i       2
+ birthdate         i       2
+ startdate         i       2
+
+\a
+continue
+* 
+
+.fi
+The help command lists overall information
+about the employee relation
+together with each attribute, its
+type and its length.
+
+INGRES supports three data types: integer numbers,
+floating point numbers, and characters strings.
+Character domains can be from 1 to 255 characters
+in length.
+Integer domains can be 1, 2, or 4 bytes in length.
+This means that integers can obtain a maximum
+value of 127; 32,767; and 2,147,483,647 respectively.
+Floating point numbers can be either 4 or 8 bytes.
+Both hold a maximum value of about 10**38;
+with 7 or 17 digit accuracy respectively.
+
+To look at all domains we could use the print command
+or we could use the retrieve command and
+list each domain in the target list.
+INGRES provides a shorthand way of doing just that.
+Try the following:
+.nf
+
+* range of e is employee
+* retrieve (e.all)
+* \\g
+Executing . . .
+
+
+|number|name                |salary|manage|birthd|startd|
+|-------------------------------------------------------|
+|   157|Jones, Tim          | 12000|   199|  1940|  1960|
+|  1110|Smith, Paul         |  6000|    33|  1952|  1973|
+|    35|Evans, Michael      |  5000|    32|  1952|  1974|
+|   129|Thomas, Tom         | 10000|   199|  1941|  1962|
+|    13|Edwards, Peter      |  9000|   199|  1928|  1958|
+|   215|Collins, Joanne     |  7000|    10|  1950|  1971|
+|    55|James, Mary         | 12000|   199|  1920|  1969|
+|    26|Thompson, Bob       | 13000|   199|  1930|  1970|
+|    98|Williams, Judy      |  9000|   199|  1935|  1969|
+|    32|Smythe, Carol       |  9050|   199|  1929|  1967|
+|    33|Hayes, Evelyn       | 10100|   199|  1931|  1963|
+|   199|Bullock, J.D.       | 27000|     0|  1920|  1920|
+|  4901|Bailey, Chas M.     |  8377|    32|  1956|  1975|
+|   843|Schmidt, Herman     | 11204|    26|  1936|  1956|
+|  2398|Wallace, Maggie J.  |  7880|    26|  1940|  1959|
+|  1639|Choy, Wanda         | 11160|    55|  1947|  1970|
+|  5119|Ferro, Tony         | 13621|    55|  1939|  1963|
+|    37|Raveen, Lemont      | 11985|    26|  1950|  1974|
+|  5219|Williams, Bruce     | 13374|    33|  1944|  1959|
+|  1523|Zugnoni, Arthur A.  | 19868|   129|  1928|  1949|
+|   430|Brunet, Paul C.     | 17674|   129|  1938|  1959|
+|   994|Iwano, Masahiro     | 15641|   129|  1944|  1970|
+|  1330|Onstad, Richard     |  8779|    13|  1952|  1971|
+|    10|Ross, Stanley       | 15908|   199|  1927|  1945|
+|    11|Ross, Stuart        | 12067|     0|  1931|  1932|
+|-------------------------------------------------------|
+\a
+continue
+*
+
+.fi
+"All" is a keyword which is expanded by
+INGRES to become all domains.
+The domains are not guaranteed to be in any particular order.
+The previous query is equivalent to:
+.nf
+
+       range of e is employee
+       retrieve (e.number, e.name, e.salary, e.manager
+               e.birthdate, e.startdate)
+
+.fi
+Let's retrieve the salary of Stan Ross.
+At this point we will need to be able
+to type both upper and lower case letters.
+If you are on an upper case only terminal,
+type a single "\\" before a letter
+you wish to capitalize.
+Thus on an upper case only terminal
+type "\\ROSS, \\STAN".
+If you are on an upper and lower case
+terminal, use the shift key to
+capitalize a letter.
+
+Run the query:
+.nf
+
+* retrieve (e.name,e.salary)
+* where e.name = "Ross, Stan"
+* \\g
+Executing . . .
+
+
+|name                |salary|
+|---------------------------|
+|---------------------------|
+\a
+continue
+*
+
+.fi
+The result is empty.
+There is no e.name which satisfies the qualification.
+That's strange because we know there is a Stan Ross.
+However, INGRES does not know, for example, that "Stanley"
+and "Stan" are semantically the same.
+
+To get the correct answer in this
+situation you may use the special
+"pattern matching" characters
+provided by INGRES.
+
+One such character is "*".
+It matches any string of zero or more characters.
+Try the query:
+.nf
+
+* retrieve (e.name,e.salary)
+* where e.name = "Ross, S*"
+* \\g
+Executing . . .
+
+
+|name                |salary|
+|---------------------------|
+|Ross, Stanley       | 15908|
+|Ross, Stuart        | 12067|
+|---------------------------|
+\a
+continue
+*
+
+.fi
+In the first case "*" matched the string "tanley" and
+in the second case it matched "tuart".
+
+Here is another example.
+Find the salaries of all people
+whose first name is "Paul":
+.nf
+
+* retrieve (e.name,e.salary)
+* where e.name = "*,Paul*"
+* \\g
+Executing . . .
+
+
+|name                |salary|
+|---------------------------|
+|Smith, Paul         |  6000|
+|Brunet, Paul C.     | 17674|
+|---------------------------|
+\a
+continue
+*
+
+.fi
+Notice that if we had asked for e.name = "*,Paul"
+we would not have gotten the second tuple.
+Also,
+INGRES ignores blanks
+in any character
+comparison whether using pattern matching
+characters or not.
+This means that the following would all give the same results:
+.nf
+
+       e.name = "Ross,Stanley"
+       e.name = "Ross,   Stanley   "
+       e.name = "R o s s,Stanley"
+
+.fi
+Particular characters or ranges of characters can be put
+in square brackets ([]).
+For example, find all people whose names start with
+"B" through "F":
+.nf
+
+* retrieve (e.name,e.salary)
+* where e.name = "[B-F]*"
+* \\g
+Executing . . .
+
+
+|name                |salary|
+|---------------------------|
+|Evans, Michael      |  5000|
+|Edwards, Peter      |  9000|
+|Collins, Joanne     |  7000|
+|Bullock, J.D.       | 27000|
+|Bailey, Chas M.     |  8377|
+|Choy, Wanda         | 11160|
+|Ferro, Tony         | 13621|
+|Brunet, Paul C.     | 17674|
+|---------------------------|
+\a
+continue
+*
+
+.fi
+Notice that this last query could be done another way:
+.nf
+
+* retrieve (e.name,e.salary)
+* where e.name >"B" and e.name <"G"
+* \\g
+Executing . . .
+
+
+|name                |salary|
+|---------------------------|
+|Evans, Michael      |  5000|
+|Edwards, Peter      |  9000|
+|Collins, Joanne     |  7000|
+|Bullock, J.D.       | 27000|
+|Bailey, Chas M.     |  8377|
+|Choy, Wanda         | 11160|
+|Ferro, Tony         | 13621|
+|Brunet, Paul C.     | 17674|
+|---------------------------|
+\a
+continue
+*
+
+.fi
+The two results are identical;
+however, the second way is generally
+more efficient for INGRES to process.
+
+There are three types of pattern matching constructs.
+All three can be used in any combination for
+character comparison.
+They are:
+
+.in +8
+.ti -4
+*   matches any length character string
+.ti -4
+?   matches any one (non-blank) character
+.ti -4
+[ ] can match any character listed in the brackets.
+If two characters are separated by a dash (-),
+then it matches any character falling
+between the two characters.
+.in -8
+
+The special meaning of a pattern matching
+character can be turned off by preceeding
+it with a "\\".
+This means that "\\*" refers to the character
+"*".
+
+We turn now to the aggregation
+facilities supported by INGRES.
+This allows a user to perform computations
+on whole domains of a relation.
+For example, one aggregate is average (avg).
+To compute the average salary for all employees, we enter:
+.nf
+
+* retrieve (avgsal=avg(e.salary))
+* \\g
+Executing . . .
+
+
+|avgsal    |
+|----------|
+| 11867.520|
+|----------|
+\a
+continue
+*
+
+.fi
+The particular title "avgsal"
+is arbitrary, but necessary;
+INGRES needs
+.ul
+some
+sort of title for any
+expression in the target list
+(other than a simple domain).
+
+We can also find the minimum and maximum salaries:
+.nf
+
+* retrieve (minsal=min(e.salary),maxsal=max(e.salary))
+* \\g
+Executing . . .
+
+
+|minsal|maxsal|
+|-------------|
+|  5000| 27000|
+|-------------|
+\a
+continue
+*
+
+.fi
+If we wanted to know the names of the employees who
+make the minimum and maximum salaries, that query would be:
+.nf
+
+* retrieve (e.name, e.salary)
+* where e.salary = min(e.salary) or e.salary = max(e.salary)
+* \\g
+Executing . . .
+
+|name                |salary|
+|---------------------------|
+|Evans, Michael      |  5000|
+|Bullock, J.D.       | 27000|
+|---------------------------|
+\a
+continue
+* 
+
+.fi
+INGRES supports the following aggregates:
+.nf
+
+       count
+       min
+       max
+       avg
+       sum
+       any
+
+.fi
+We now indicate the query to list each employee along
+with the average salary for all employees:
+.nf
+
+* retrieve (e.name,peersal=avg(e.salary))
+* \\g
+Executing . . .
+
+
+|name                |peersal   |
+|-------------------------------|
+|Jones, Tim          | 11867.520|
+|Smith, Paul         | 11867.520|
+|Evans, Michael      | 11867.520|
+|Thomas, Tom         | 11867.520|
+|Edwards, Peter      | 11867.520|
+|Collins, Joanne     | 11867.520|
+|James, Mary         | 11867.520|
+|Thompson, Bob       | 11867.520|
+|Williams, Judy      | 11867.520|
+|Smythe, Carol       | 11867.520|
+|Hayes, Evelyn       | 11867.520|
+|Bullock, J.D.       | 11867.520|
+|Bailey, Chas M.     | 11867.520|
+|Schmidt, Herman     | 11867.520|
+|Wallace, Maggie J.  | 11867.520|
+|Choy, Wanda         | 11867.520|
+|Ferro, Tony         | 11867.520|
+|Raveen, Lemont      | 11867.520|
+|Williams, Bruce     | 11867.520|
+|Zugnoni, Arthur A.  | 11867.520|
+|Brunet, Paul C.     | 11867.520|
+|Iwano, Masahiro     | 11867.520|
+|Onstad, Richard     | 11867.520|
+|Ross, Stanley       | 11867.520|
+|Ross, Stuart        | 11867.520|
+|-------------------------------|
+\a
+continue
+*
+
+.fi
+An aggregate always evaluates to a single value.
+To process the last query,
+INGRES replicated the average salary next to
+each e.name.
+
+Aggregates can have their own qualification.
+For example, we can retrieve a list of each
+employee along with the average salary
+of those employees over 50.
+.nf
+
+* retrieve (e.name,peersal=
+* avg(e.salary where 1977-e.birthdate > 50))
+* \\g
+Executing . . .
+
+
+|name                |peersal   |
+|-------------------------------|
+|Jones, Tim          | 19500.000|
+|Smith, Paul         | 19500.000|
+|Evans, Michael      | 19500.000|
+|Thomas, Tom         | 19500.000|
+|Edwards, Peter      | 19500.000|
+|Collins, Joanne     | 19500.000|
+|James, Mary         | 19500.000|
+|Thompson, Bob       | 19500.000|
+|Williams, Judy      | 19500.000|
+|Smythe, Carol       | 19500.000|
+|Hayes, Evelyn       | 19500.000|
+|Bullock, J.D.       | 19500.000|
+|Bailey, Chas M.     | 19500.000|
+|Schmidt, Herman     | 19500.000|
+|Wallace, Maggie J.  | 19500.000|
+|Choy, Wanda         | 19500.000|
+|Ferro, Tony         | 19500.000|
+|Raveen, Lemont      | 19500.000|
+|Williams, Bruce     | 19500.000|
+|Zugnoni, Arthur A.  | 19500.000|
+|Brunet, Paul C.     | 19500.000|
+|Iwano, Masahiro     | 19500.000|
+|Onstad, Richard     | 19500.000|
+|Ross, Stanley       | 19500.000|
+|Ross, Stuart        | 19500.000|
+|-------------------------------|
+\a
+continue
+*
+
+.fi
+Contrast the previous query with this next one.
+We will retrieve the names of those employees over fifty and
+retrieve the average salary for all employees.
+.nf
+
+* retrieve (e.name,peersal=avg(e.salary))
+* where 1977-e.birthdate > 50
+* \\g
+Executing . . .
+
+
+|name                |peersal   |
+|-------------------------------|
+|James, Mary         | 11867.520|
+|Bullock, J.D.       | 11867.520|
+|-------------------------------|
+\a
+continue
+*
+
+.fi
+There is a very important distinction between these
+last two queries.
+An aggregate is completely self-contained.
+It is not affected by the qualification of the
+query as a whole.
+
+In the first case, average is computed only for
+those employees over fifty, and all employees are retrieved.
+In the second case, however, average is computed for all
+employees but only those employees over 50 are retrieved.
+
+If we wanted a list of all employees over fifty together
+with the average salary of employees over fifty,
+we would combine the previous two queries into one.
+That query would be:
+
+.nf
+* retrieve (e.name, peersal=
+* avg(e.salary where 1977 - e.birthdate > 50))
+* where 1977 - e.birthdate > 50
+* \\g
+Executing . . .
+
+
+|name                |peersal   |
+|-------------------------------|
+|James, Mary         | 19500.000|
+|Bullock, J.D.       | 19500.000|
+|-------------------------------|
+\a
+continue
+* 
+
+.fi
+It is sometimes useful to have duplicate values removed before
+an aggregation is computed.
+For example if you wanted to know how many managers there are,
+the following query will not give the right answer:
+
+.nf
+* retrieve (bosses = count(e.manager))
+* \\g
+* Executing . . .
+
+
+|bosses       |
+|-------------|
+|           25|
+|-------------|
+\a
+continue
+* 
+
+.fi
+Notice that that gives the count of how many tuples there are in
+employee.
+What we want to know is
+how many unique e.manager's there are.
+
+INGRES provides three special forms of
+aggregation.
+
+.nf
+       countu          count unique values
+       avgu            average unique values
+       sumu            sum unique values
+.fi
+
+It's interesting to note that minu, maxu, and anyu are
+not needed.
+Their values would be the same whether duplicates were
+removed or not.
+
+The correct query to find the number of managers is:
+
+.nf
+* retrieve (bosses=countu(e.manager))
+* \\g
+Executing . . .
+
+
+|bosses       |
+|-------------|
+|            9|
+|-------------|
+\a
+continue
+*
+
+.fi
+Another aggregate facility supported by INGRES is called aggregate functions.
+Aggregate functions group
+data into categories and perform separate aggregations on each category.
+
+For example,
+what if you wanted to retrieve each employee,
+and the average salary paid to employees with the same manager?
+That query would be:
+.nf
+
+* retrieve (e.name,manageravg=avg(e.salary by e.manager))
+* \\g
+Executing . . .
+
+
+|name                |manageravg|
+|-------------------------------|
+|Jones, Tim          | 11117.555|
+|Thomas, Tom         | 11117.555|
+|Edwards, Peter      | 11117.555|
+|James, Mary         | 11117.555|
+|Thompson, Bob       | 11117.555|
+|Williams, Judy      | 11117.555|
+|Smythe, Carol       | 11117.555|
+|Hayes, Evelyn       | 11117.555|
+|Ross, Stanley       | 11117.555|
+|Smith, Paul         |  9687.000|
+|Williams, Bruce     |  9687.000|
+|Evans, Michael      |  6688.500|
+|Bailey, Chas M.     |  6688.500|
+|Collins, Joanne     |  7000.000|
+|Bullock, J.D.       | 19533.500|
+|Ross, Stuart        | 19533.500|
+|Schmidt, Herman     | 10356.333|
+|Wallace, Maggie J.  | 10356.333|
+|Raveen, Lemont      | 10356.333|
+|Choy, Wanda         | 12390.500|
+|Ferro, Tony         | 12390.500|
+|Zugnoni, Arthur A.  | 17727.666|
+|Brunet, Paul C.     | 17727.666|
+|Iwano, Masahiro     | 17727.666|
+|Onstad, Richard     |  8779.000|
+|-------------------------------|
+\a
+continue
+*
+
+.fi
+The first nine people all have the same manager and their
+average salary is 11117.555.
+The next two people have the same manager and their average
+salary is 9687. etc.
+
+Once again, if we wanted to see the same list
+just for those employees over 50:
+.nf
+
+* retrieve (e.name,manageravg=avg(e.salary by e.manager))
+* where 1977-e.birthdate > 50
+* \\g
+Executing . . .
+
+
+|name                |manageravg|
+|-------------------------------|
+|James, Mary         | 11117.555|
+|Bullock, J.D.       | 19533.500|
+|-------------------------------|
+\a
+continue
+*
+
+.fi
+Aggregate functions (unlike simple aggregates)
+are not completely local to themselves.
+The domains upon which the data is grouped
+(called the by-list) are logically
+connected to the domains in the rest of the query.
+
+In these last examples, the "e.manager" in
+the by-list refers to the same tuple as
+"e.name" in the target list.
+
+If we wanted to compute the average salaries by
+manager for only managers 33 and 199,
+then the query would be:
+.nf
+
+* retrieve (e.name,manageravg=
+* avg(e.salary by e.manager)
+* where e.manager = 199 or e.manager = 33
+* \\g
+Executing . . .
+
+
+|name                |manageravg|
+|-------------------------------|
+|Jones, Tim          | 11117.555|
+|Thomas, Tom         | 11117.555|
+|Edwards, Peter      | 11117.555|
+|James, Mary         | 11117.555|
+|Thompson, Bob       | 11117.555|
+|Williams, Judy      | 11117.555|
+|Smythe, Carol       | 11117.555|
+|Hayes, Evelyn       | 11117.555|
+|Ross, Stanley       | 11117.555|
+|Smith, Paul         |  9687.000|
+|Williams, Bruce     |  9687.000|
+|-------------------------------|
+\a
+continue
+*
+
+.fi
+Suppose we wanted to find out
+how many people work for each
+manager, and in addition
+wanted only to include those
+employees who have worked at least seven years.
+.nf
+
+* retrieve (e.manager,people=count(e.name by e.manager where
+* e.startdate < 1970))
+* \\g
+Executing . . .
+
+
+|manage|people       |
+|--------------------|
+|   199|            8|
+|    33|            2|
+|    32|            0|
+|    10|            0|
+|     0|            2|
+|    26|            2|
+|    55|            1|
+|   129|            2|
+|    13|            0|
+|--------------------|
+\a
+continue
+*
+
+.fi
+Notice that managers 32, 10, and 13 have
+no employees who started
+before 1970.  
+Now suppose we want to know the average
+salary for those employees.
+Simply change "count" to "avg" and rerun the query.
+.nf
+
+* retrieve (e.manager,people=avg(e.salary by e.manager where
+* e.startdate < 1970))
+* \\g
+Executing . . .
+
+
+|manage|people    |
+|-----------------|
+|   199| 10882.250|
+|    33| 22687.000|
+|    32|     0.000|
+|    10|     0.000|
+|     0| 19533.500|
+|    26|  9542.000|
+|    55| 13621.000|
+|   129| 18771.000|
+|    13|     0.000|
+|-----------------|
+\a
+continue
+*
+
+.fi
+Notice what INGRES does for
+managers 32, 10 and 13.
+The average salary for those manager employees
+is actually undefined since there
+are no employees who started before 1970.
+INGRES always makes undefined values zero
+in aggregates.
+
+If you want to remove the zero values from
+the output, a qualification can be added
+to the query.  
+The following query will find the average salaries
+only for those which are greater than zero.
+.nf
+
+* retrieve (e.manager,people=avg(e.salary by e.manager where
+* e.startdate < 1970))
+* where avg(e.salary by e.manager where e.startdate < 1970) > 0
+* \\g
+Executing . . .
+
+
+|manage|people    |
+|-----------------|
+|   199| 10882.250|
+|    33| 22687.000|
+|     0| 19533.500|
+|    26|  9542.000|
+|    55| 13621.000|
+|   129| 18771.000|
+|-----------------|
+\a
+continue
+* 
+
+.fi
+Up until now we have been retrieving results directly
+onto the terminal.
+You can also save results by retrieving them into a
+new relation.
+This is done by saying:
+.nf
+
+       retrieve into newrel ( ... )
+       where . . .
+
+.fi
+The rules are exactly the same as for retrieves onto
+the terminal.
+INGRES will create the new relation with the
+correct domains, and then put the results
+of the query in the new relation.
+
+For example, create a
+new relation called "overpaid" which has only
+those employees who make more than $8000:
+.nf
+
+* retrieve into overpaid (e.all)
+* where e.salary > 8000
+* print overpaid
+* \\g
+Executing . . .
+
+
+overpaid relation
+
+|number|name                |salary|manage|birthd|startd|
+|-------------------------------------------------------|
+|    10|Ross, Stanley       | 15908|   199|  1927|  1945|
+|    11|Ross, Stuart        | 12067|     0|  1931|  1932|
+|    13|Edwards, Peter      |  9000|   199|  1928|  1958|
+|    26|Thompson, Bob       | 13000|   199|  1930|  1970|
+|    32|Smythe, Carol       |  9050|   199|  1929|  1967|
+|    33|Hayes, Evelyn       | 10100|   199|  1931|  1963|
+|    37|Raveen, Lemont      | 11985|    26|  1950|  1974|
+|    55|James, Mary         | 12000|   199|  1920|  1969|
+|    98|Williams, Judy      |  9000|   199|  1935|  1969|
+|   129|Thomas, Tom         | 10000|   199|  1941|  1962|
+|   157|Jones, Tim          | 12000|   199|  1940|  1960|
+|   199|Bullock, J.D.       | 27000|     0|  1920|  1920|
+|   430|Brunet, Paul C.     | 17674|   129|  1938|  1959|
+|   843|Schmidt, Herman     | 11204|    26|  1936|  1956|
+|   994|Iwano, Masahiro     | 15641|   129|  1944|  1970|
+|  1330|Onstad, Richard     |  8779|    13|  1952|  1971|
+|  1523|Zugnoni, Arthur A.  | 19868|   129|  1928|  1949|
+|  1639|Choy, Wanda         | 11160|    55|  1947|  1970|
+|  4901|Bailey, Chas M.     |  8377|    32|  1956|  1975|
+|  5119|Ferro, Tony         | 13621|    55|  1939|  1963|
+|  5219|Williams, Bruce     | 13374|    33|  1944|  1959|
+|-------------------------------------------------------|
+\a
+continue
+*
+
+.fi
+On a "retrieve into" nothing is printed.
+We had to include a "print" command to see
+the results.
+Also, the relation name on a "retrieve into"
+must not already exist.
+For example, if we tried
+the same query again:
+.nf
+
+* \\g
+Executing . . .
+
+5102: CREATE: duplicate relation name overpaid
+
+continue
+*
+
+.fi
+There are two special features about a "retrieve into".
+First, the result relation is automatically
+sorted and any duplicate tuples are removed.
+Second, the relation becomes part of
+the data base and is owned by you.
+If you don't want it to be saved you should
+remember to destroy it.
+The mechanism for destroying a relation will
+be mentioned a bit later.
+
+So far we have only retrieved data but never
+changed it.
+INGRES supports three update commands:
+append, replace, and delete.
+
+For example, to add "Tom Terrific" to the
+list of overpaid employees and start him
+off at $10000:
+.nf
+
+* append to overpaid(name = "Terrific, Tom",salary = 10000)
+* \\g
+Executing . . .
+
+\a
+continue
+*
+
+.fi
+Notice that we specified values for only two of the
+six domains in "overpaid".
+That is fine.
+INGRES will automatically set numeric domains
+to zero and character domains to blank, if
+they are not specified.
+
+Notice also that INGRES did not print anything after
+the query.
+This is true for all update commands.
+
+Let's give everyone in overpaid a 10% raise.
+To do this we want to replace o.salary by
+1.1 times its value.
+Type the query:
+.nf
+
+* range of o is overpaid
+* replace o(salary = o.salary * 1.1)
+* \\g
+Executing . . .
+
+\a
+continue
+*
+
+.fi
+While the append command requires that you give a
+relation name (e.g. append to overpaid), the
+replace and delete commands require a
+tuple variable.
+Note that the command is:
+.nf
+
+       replace o ( . . . )
+               where . . .
+
+and not:
+
+       replace overpaid ( . . . )
+               where . . .
+
+.fi
+Print the results of these
+last two updates:
+.nf
+
+* print overpaid
+* \\g
+Executing . . .
+
+
+overpaid relation
+
+|number|name                |salary|manage|birthd|startd|
+|-------------------------------------------------------|
+|    10|Ross, Stanley       | 17498|   199|  1927|  1945|
+|    11|Ross, Stuart        | 13273|     0|  1931|  1932|
+|    13|Edwards, Peter      |  9899|   199|  1928|  1958|
+|    26|Thompson, Bob       | 14299|   199|  1930|  1970|
+|    32|Smythe, Carol       |  9954|   199|  1929|  1967|
+|    33|Hayes, Evelyn       | 11109|   199|  1931|  1963|
+|    37|Raveen, Lemont      | 13183|    26|  1950|  1974|
+|    55|James, Mary         | 13199|   199|  1920|  1969|
+|    98|Williams, Judy      |  9899|   199|  1935|  1969|
+|   129|Thomas, Tom         | 10999|   199|  1941|  1962|
+|   157|Jones, Tim          | 13199|   199|  1940|  1960|
+|   199|Bullock, J.D.       | 29699|     0|  1920|  1920|
+|   430|Brunet, Paul C.     | 19441|   129|  1938|  1959|
+|   843|Schmidt, Herman     | 12324|    26|  1936|  1956|
+|   994|Iwano, Masahiro     | 17205|   129|  1944|  1970|
+|  1330|Onstad, Richard     |  9656|    13|  1952|  1971|
+|  1523|Zugnoni, Arthur A.  | 21854|   129|  1928|  1949|
+|  1639|Choy, Wanda         | 12275|    55|  1947|  1970|
+|  4901|Bailey, Chas M.     |  9214|    32|  1956|  1975|
+|  5119|Ferro, Tony         | 14983|    55|  1939|  1963|
+|  5219|Williams, Bruce     | 14711|    33|  1944|  1959|
+|     0|Terrific, Tom       | 11000|     0|     0|     0|
+|-------------------------------------------------------|
+\a
+continue
+*
+
+.fi
+Let's fire whoever has the smallest salary:
+.nf
+
+* delete o where o.salary = min(o.salary) \\g
+Executing . . .
+
+
+continue
+*
+
+.fi
+Notice that the delete command requires
+a tuple variable (eg. delete o)
+and not a relation name.
+
+What if we wanted to know who makes more that
+Tom Terrific?
+The query to do this is very subtle.
+First we use a new tuple variable called
+"t" which ranges over overpaid,
+and will be used to refer to Tom.
+t.name must equal "Terrific, Tom".
+Next, we use a tuple variable called "o"
+which will scan the whole relation.
+If we ever find an o.salary > t.salary
+then o.name must make more than Tom.
+
+The complete query is:
+.nf
+
+* range of t is overpaid
+* retrieve (o.name, osal=o.salary, tomsal = t.salary)
+* where o.salary > t.salary
+* and t.name = "Terrific, Tom"
+* \\g
+* Executing . . .
+
+
+|name                |osal  |tomsal|
+|----------------------------------|
+|Ross, Stanley       | 19247| 11000|
+|Ross, Stuart        | 14600| 11000|
+|Thompson, Bob       | 15728| 11000|
+|Hayes, Evelyn       | 12219| 11000|
+|Raveen, Lemont      | 14501| 11000|
+|James, Mary         | 14518| 11000|
+|Thomas, Tom         | 12098| 11000|
+|Jones, Tim          | 14518| 11000|
+|Bullock, J.D.       | 32668| 11000|
+|Brunet, Paul C.     | 21385| 11000|
+|Schmidt, Herman     | 13556| 11000|
+|Iwano, Masahiro     | 18925| 11000|
+|Zugnoni, Arthur A.  | 24039| 11000|
+|Choy, Wanda         | 13502| 11000|
+|Ferro, Tony         | 16481| 11000|
+|Williams, Bruce     | 16182| 11000|
+|----------------------------------|
+\a
+continue
+* 
+
+.fi
+If we wanted to give Tom Terrific $50 more
+than anyone else, the query would be:
+.nf
+
+* replace o(salary = max(o.salary) + 50)
+* where o.name = "Terrific, Tom"
+* \\g
+Executing . . .
+
+\a
+continue
+* 
+
+.fi
+Finally, to destroy a relation owned by
+yourself, type the command:
+.nf
+
+* destroy overpaid
+* \\g
+Executing . . .
+
+
+Continue
+*
+
+.fi
+We are now ready to leave INGRES.
+This is done either by typing
+an end-of-file (control/d)
+or more typically use the "\\q"
+command:
+.nf
+
+* \\q
+INGRES vers 6.1/0 logout
+Tue Aug 30 14:55:20 1977
+goodbye bob -- come again
+.fi
diff --git a/usr/src/ucb/ingres/doc/other/v5v6diff.nr b/usr/src/ucb/ingres/doc/other/v5v6diff.nr
new file mode 100644 (file)
index 0000000..30c845d
--- /dev/null
@@ -0,0 +1,267 @@
+.de HE 'Version six changes'INGRES'%'
+.so nmacs
+Users of INGRES version five should be aware of certain differences
+between version five and version six.
+Version six fixes all the known bugs that were in version five.
+Some of these fixes and improvements might cause
+some version five queries to not run correctly on version six.
+For this reason, we have itemized the changes which
+you should be aware of.
+Refer to the new version six reference manual for additional details.
+
+.sh 1
+Storage Structures.
+.dn
+Incompatibilities.
+.PS
+Version six of INGRES will NOT run on a
+version five data base.
+All data bases must be recreated.
+There is a utility program called
+"copydb5" which aids in the 
+conversion process.
+Refer to the INGRES reference manual
+under copydb(UNIX) for documentation
+on how to use copydb5.
+.sh 1
+Monitor
+.dn
+Different working directory
+.PS
+The monitor now runs in the working
+directory where the user was at the
+time INGRES was invoked.
+This means that when you escape to the
+shell or the editor, you will
+be in the same working directory as
+when you invoked INGRES.
+.sh
+Auto-clear mode
+.PS
+The version five monitor required you to
+reset the workspace after a query ("\\r").
+The version six monitor does approximately
+the opposite.
+
+If the first line after a query does NOT
+begin with the command "\\p", "\\g", "\\e", or "\\a", then
+the monitor automatically resets the workspace
+for you.
+Otherwise, the command is interpreted and new lines are
+appended to the workspace.
+The autoclear feature can be suppressed by using
+the "-a" flag when invoking INGRES.
+Once you use the autoclear feature for a while,
+however, you will really appreciate it.
+.sh
+Rubout works! (nearly always)
+.PS
+Typing a rubout or break causes INGRES to
+stop what it is doing and return cleanly
+to the monitor.
+If a rubout is typed during a modify or defered
+update, a message is issued and further rubouts
+are ignored until the processing is complete.
+
+Many critical sections in the INGRES
+code still exist
+where typing a rubout can cause a
+SYSERR message.
+Those are being cleaned out on a gradual basis.
+In general rubout processing works correctly and in
+any case will never hurt the data base if all
+you are doing is a retrieve
+or a print.
+.sh 1
+Parser
+.dn
+New keywords and features.
+.PS
+We have implemented two new commands:
+CONCAT and ASCII.
+Those words are now reserved words.
+ASCII converts a numeric of any type to
+a character string.
+CONCAT takes two character strings and forms
+a new one.
+Trailing blanks of the first character string are
+removed before concatenating the second string.
+.sh
+The shorthand notation x.all.
+.PS
+ALL can be used in retrieves and appends.
+Its meaning expands to be all domains of
+a relation.
+The order of the domains is nearly always the
+same as the order from the create statement;
+however, this is not presently guaranteed.
+.sh
+Pattern matching
+.PS
+We have implemented the "shell syntax" pattern
+matching characters "*", "?", "[]".
+They can be used in a qualification but not
+in a target list.
+Their special meaning
+can be turned off by preceding them with a
+"\\".
+.sh
+Correct precedence.
+.PS
+The parser now gives the correct precedence
+to numeric operators.
+It previously gave equal precedence
+to all numeric operators (+,*,**, etc.).
+.sh 1
+Copy
+.dn
+File modes.
+.PS
+The previous version of copy created files
+owned as INGRES in mode 666, and demanded
+that any file to be read must be
+readable by INGRES.
+
+The version six copy
+runs as the user.
+Thus on coping into a relation, the
+UNIX file need be readable only by the
+real users.
+On a copy out of a relation, the file
+is created in mode 600 and is owned by the
+real user.
+.sh
+Copy "into" works correctly.
+.PS
+The version five "copy into" ignored the
+order of the domains and demanded that
+all domains be present and in the
+identical format as the relation.
+
+The version six copy eliminates all those
+restriction, both on copy into and copy from.
+.sh 1
+Help
+.dn
+Help on a relation/manual is changed.
+.PS
+We have reversed the use of the help command.
+Relations names should be given without
+quotes ("") and manual sections should
+include them.
+This is consistent with the print command.
+.sh
+Documentation reorganized.
+.PS
+The INGRES documentation has been subdivided
+into quel, unix, files and error sections.
+The help command no longer looks in /usr/man/...
+for documentation.
+.sh 2
+Help "" changed.
+.PS
+"Help" alone
+now lists relations
+in the database
+instead of the help page
+of the reference manual.
+Help ""
+no longer exists.
+.sh 1
+Purge
+.dn
+An easy way to clean up a data base
+.PS
+The purge command (formerly resetdb and relkiller) provides
+an easy way to see what relations have expired
+and also to remove any temporary files and
+relations which were left over after a system error.
+.sh 1
+The Users File.
+.dn
+The users file replaces the authority file
+.PS
+The users file specifies who can use INGRES,
+what data bases the user can use,
+special permissions the user has,
+any default flags the user wants.
+
+The users file can provide some protection to
+a data base but is obviously insufficient.
+What protection it provides was implemented
+only because it was easy to provide and
+somewhat useful.
+.sh 1
+EQUEL
+.dn
+Recompilation
+.PS
+A version five equel program must
+be preprocessed again and then
+recompiled in order to run on
+a version six data base.
+
+If you run an equel program without
+recompiling you will get
+an error message from INGRES informing
+you to redo your equel program.
+
+If you only recompile and don't first
+run the equel preprocessor,
+you will get an undefined reference
+to "skiptup" at load time.
+
+Again, simply run equel on all ".q"
+files and then recompile your programs.
+.sh
+Retrieving domains
+.PS
+The version five EQUEL allowed you to retrieve a numeric
+domains into a character variable.
+Version six does not allow this directly.
+The ASCII command can be used to perform this
+function.
+.sh
+The debug flag
+.PS
+Version five equel printed the file name and line
+number on an error.
+This required a lot of extra storage at run time.
+Version six equel has a "-d" flag which
+passes file and line information
+on an error.
+Otherwise, the information is not kept.
+.sh 1
+Miscellaneous.
+.dn
+Relation Names.
+.PS
+Version five relation names appended the users
+UNIX group and user id's to a relation name.
+INGRES user id's are now kept
+in the "users" file and are printing
+characters starting with "aa", "ab", and up.
+.sh
+Running as someone else.
+.PS
+For data base administrators with alter-ego
+problems, INGRES now lets you run as
+someone other than yourself.
+The "-u" flag can be used at the time
+INGRES is invoked to let you run as
+a different user.
+The "-u" flag may also be used
+by the "ingres" user.
+
+The "-u" flag is also available
+in creatdb.
+It may only be used by the "ingres" user
+in this context.
+.sh
+The Blip is Gone.
+.PS
+Version five printed a space followed by a
+backspace, at the start of every query and
+dbu request.
+The "blip" was there for historical reasons
+only and has been removed.
diff --git a/usr/src/ucb/ingres/doc/other/v6v61diff.nr b/usr/src/ucb/ingres/doc/other/v6v61diff.nr
new file mode 100644 (file)
index 0000000..28c3083
--- /dev/null
@@ -0,0 +1,335 @@
+.ds HE 'Version 6.1 Changes'INGRES'Page %'
+.so nmacs
+Version 6.1 of INGRES is upward compatable with version 6.0
+of INGRES and contains a number of new features.
+The most important of these are improved aggregation
+capabilities,
+macros in the monitor,
+full concurrency control,
+and overall speed
+improvement.
+
+The only incompatability with version 6.0 is that
+secondary indices are stored differently internally
+and the default for "retrieve into" is now "cheapsort".
+.sh 1
+Incompatibilities.
+.dn
+Secondary Indices.
+.PS
+We have learned that the way in which we formed
+internal tuple identifiers was not
+optimal for secondary indices.
+Consequently we have changed the format of
+tuple identifiers (tid).
+
+Secondary indices must either be
+destroyed and recreated or else use
+the program "indconv" to convert the secondary indices.
+Refer to the accompaning document "indconv(unix)"
+for details.
+.sh
+Retrieve into defaults to cheapsort.
+.PS
+On a "retrieve into" the result relation
+used to be modified to "isam".
+The default has been changed to be cheapsort.
+The primary advantage of this is that you
+don't have the extra processing time needed
+for the modify to isam.
+
+As in the past the default can be overridden
+at the time INGRES is invoked by using
+the "-r" flag.
+Refer to ingres(unix) for details.
+.sh 1
+Monitor
+.dn
+Saving and restoring queries.
+.PS
+Three new commands have
+been added to help in saving and
+restoring queries.
+They are:
+.nf
+
+       \\chdir directory       (change directory)
+       \\include file  (switch input to file)
+       \\write file    (write query buffer to file)
+
+.fi
+.sh
+Alternate Monitor Commands.
+.PS
+The Monitor allows you to spell out commands.
+Thus "\\go" is the same as "\\g".
+Refer to monitor(quel) for a complete list.
+.sh 1
+Parser.
+.dn
+Special conversion functions.
+.PS
+There are five conversion
+functions: int1, int2, int4, float4, float8.
+They allow you to specify the type of
+any arithmetic expression.
+For example:
+
+.nf
+range of e is employee
+retrieve (total = sum(int4(e.salary)))
+
+.fi
+This will take each e.salary and convert it
+to an i4 before summing.
+The conversion functions can also be used
+to convert character values to
+numeric values.
+.sh
+Improved range table.
+.PS
+The range table is now completely
+organized according to least recently
+used.
+This means that when you declare more
+than ten tuple variables, the variable
+least recently referenced is
+discarded.
+.sh
+New Aggregates.
+Aggregate facilities have been expanded to include
+countu, sumu, and avgu.
+These aggregate only unique values.
+INGRES removes all duplicates before
+performing the specified aggregate.
+For example if the query asks for
+
+avgu(p.qoh * p.weight)
+
+Then the average will be performed only
+on the unique values of the product of
+p.qoh * p.weight.
+.sh
+Bugs involving "NOT" and "OR" fixed.
+.PS
+There were several bugs involving
+queries with NOT and OR in the
+qualification.
+Those bugs have all been fixed.
+.sh
+Default for INDEX on "-n" flag.
+.PS
+When invoking INGRES,
+the -n flag can be used to specify the default
+structure for relations created by the "index"
+command.
+.sh
+ASCII command accepts character values.
+.PS
+ASCII has been changed to accept and ignore
+character values.
+This can be useful for equel programs since
+ascii(any domain) can always be retrieved
+into a variable of type character.
+.sh 1
+OVQP
+.dn
+Correct handling of I1 and F4.
+.PS
+In the past, a retrieve to the terminal
+of an i1 or a f4 domain was handled as if
+the domain were an i2 or f8 respectively.
+This mattered only when using the -i1 or -f4
+flags when invoking INGRES.
+.sh 1
+DECOMP
+.dn
+Aggregate functions no longer produce a cross-product.
+.PS
+In the past,
+if more than one aggregate function was specified on
+a variable,
+the system incorrectly produced a cross product
+on the resulting aggregates.
+This bug has been fixed and matching by-lists on
+aggregate functions are always linked correctly
+to the rest of the query.
+.sh
+Multi-variable and nested aggregates.
+.PS
+You can now have aggregates which involve
+more than one relations.
+For example, a lot of people have wanted
+to know how many suppliers supply the
+central processor:
+
+.nf
+
+range of p is parts
+range of s is supply
+retrieve (goodnews = count(s.snum where s.pnum = p.pnum
+       and p.pname = "central processor"))
+.fi
+
+.sh
+Processing of aggregates in parallel.
+.PS
+Whenever possible,
+two or more aggregates
+are processed
+on the same pass through the relation.
+This means that in the query:
+
+.nf
+range of p is parts
+retrieve (
+       p.color,
+       cnt = count(p.pname by p.color),
+       wt  = sum(p.weight by p.color)
+       )
+
+.fi
+the sum and count would be computed
+with only one pass over parts.
+.sh
+New Definition of Aggregate Functions.
+.PS
+In previous versions of INGRES,
+if a "by-domain" value was excluded
+by the qualification,
+the aggregate value of the "by-domain"
+was undefined.
+Starting with version 6.1 an
+undefined value always defaults to zero.
+
+Simple aggregates always defaulted to zero
+if undefined.
+Aggregate functions are now consistant with
+that definition.
+
+For example:
+
+.nf
+range of e is employee
+retrieve (e.manager, people =
+       count(e.name by e.manager where
+       e.startdate < 1970))
+.fi
+
+If there is a manager with no employee
+who started before 1970 then the count will
+be zero.
+Previously no value would have appeared
+for the manager.
+.sh 1
+DBU
+.dn
+Destroy, Help, and Print can take lists of relations
+.PS
+Destroy, help, and print can now take a comma
+separated list of agruments.
+.sh
+System relations cannot be "modified"
+.PS
+You can no longer use the modify
+command on system relations.
+A separate stand-alone program
+called "sysmod" must be used
+to modify the system relations to
+their optimal structure.
+.sh
+Sorting a relation stored as a heap.
+.PS
+A heap can be sorted and duplicates
+removed using the modify command:
+.br
+
+modify relname to heapsort on domain1, domain2 ...
+.br
+
+The relation is sorted on the specified domains
+and left as a heap.
+This is faster than modifying the relation to isam.
+
+This is useful when it is
+desired to have the final output sorted
+in some particular order.
+.sh
+Specifing the occupancy of an isam or hash relation
+.PS
+The modify command now accepts user information
+pertaining to how much room to leave when
+modifing a relation to isam or hash.
+The new specifications are:
+
+fillfactor (how much empty space to leave on each page.
+Defaults are hash:50%, chash:75%, isam:80%, cisam:100%)
+.br
+minpages (hash only. Minimum number of primary pages desired.
+Default is ten pages.)
+.br
+maxpages (hash only. Maximum number of primary pages desired.
+Default is 2**24.)
+
+For example:
+
+modify parts to hash on pnum where fillfactor = 100
+
+modify emp to hash on eno where fillfactor = 50
+and minpages = 300
+
+.sh
+COPY allows delimitor specifications.
+.PS
+The c0 and d0 options on copy have been extended to
+allow individual delimitor specification.
+The general format is dom = c0delim.
+
+For example on a copy "from",
+pname = c0nl will accept only a nl as a delimitor.
+
+On a copy "into" the construction pname = c0nl is
+functionally identical to asking for
+pname = c0, nl = d1.
+.sh 1
+Miscellaneous.
+.PS
+.dn
+Concurrency Control.
+.PS
+INGRES now has full concurrency control.
+By default all new data bases will have
+concurrency control turned on.
+Existing data bases can be easily upgraded
+to have concurrency control.
+Refer to creatdb(unix) for details.
+.sh
+Pathname can be changed without recompilation.
+.PS
+The INGRES pathname "/mnt/ingres" is no
+longer a defined constant.
+Instead INGRES scans the /etc/passwd file
+and uses the initial working
+directory of the user "ingres".
+.sh
+Restore Expanded.
+.PS
+Restore has been improved and expanded to
+provide recovery from modify, index,
+create, and destroy commands in addition
+to append, delete, and replace commands.
+.sh
+Sysmod.
+.PS
+Since the structure of the system relations
+is extremely important,
+we now provide a stand-alone program which
+modifies the relation, attribute, and indexes
+relations to their optimal structure.
+
+You are no longer allowed to do this
+using the modify command.
+This both prevents the relations from being
+accidentally modified to a useless structure,
+and allows INGRES to make certain assumptions
+which improves performance everywhere.