Index: doc/src/sgml/advanced.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/advanced.sgml,v
retrieving revision 1.31
diff -c -r1.31 advanced.sgml
*** doc/src/sgml/advanced.sgml	11 Nov 2002 20:14:02 -0000	1.31
--- doc/src/sgml/advanced.sgml	18 Feb 2003 02:13:27 -0000
***************
*** 41,47 ****
     <para>
      Refer back to the queries in <xref linkend="tutorial-join">.
      Suppose the combined listing of weather records and city location
!     is of particular interest to your application, but you don't want
      to type the query each time you need it.  You can create a
      <firstterm>view</firstterm> over the query, which gives a name to
      the query that you can refer to like an ordinary table.
--- 41,47 ----
     <para>
      Refer back to the queries in <xref linkend="tutorial-join">.
      Suppose the combined listing of weather records and city location
!     is of particular interest to your application, but you do not want
      to type the query each time you need it.  You can create a
      <firstterm>view</firstterm> over the query, which gives a name to
      the query that you can refer to like an ordinary table.
***************
*** 232,238 ****
     </para>
  
     <para>
!     If, partway through the transaction, we decide we don't want to
      commit (perhaps we just noticed that Alice's balance went negative),
      we can issue the command <command>ROLLBACK</> instead of
      <command>COMMIT</>, and all our updates so far will be canceled.
--- 232,238 ----
     </para>
  
     <para>
!     If, partway through the transaction, we decide we do not want to
      commit (perhaps we just noticed that Alice's balance went negative),
      we can issue the command <command>ROLLBACK</> instead of
      <command>COMMIT</>, and all our updates so far will be canceled.
***************
*** 240,246 ****
  
     <para>
      <productname>PostgreSQL</> actually treats every SQL statement as being
!     executed within a transaction.  If you don't issue a <command>BEGIN</>
      command, 
      then each individual statement has an implicit <command>BEGIN</> and
      (if successful) <command>COMMIT</> wrapped around it.  A group of
--- 240,246 ----
  
     <para>
      <productname>PostgreSQL</> actually treats every SQL statement as being
!     executed within a transaction.  If you do not issue a <command>BEGIN</>
      command, 
      then each individual statement has an implicit <command>BEGIN</> and
      (if successful) <command>COMMIT</> wrapped around it.  A group of
Index: doc/src/sgml/arch-dev.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/arch-dev.sgml,v
retrieving revision 2.17
diff -c -r2.17 arch-dev.sgml
*** doc/src/sgml/arch-dev.sgml	19 Jan 2003 00:13:28 -0000	2.17
--- doc/src/sgml/arch-dev.sgml	18 Feb 2003 02:47:14 -0000
***************
*** 17,31 ****
  
    <para>
     This chapter gives an overview of the internal structure of the
!    backend of <productname>PostgreSQL</productname>.
!    After having read the following sections you
!    should have an idea of how a query is processed. Don't expect a
!    detailed description here (I think such a description dealing with
!    all data structures and functions used within <productname>PostgreSQL</productname>
!    would exceed 1000
!    pages!). This chapter is intended to help understanding the general
!    control and data flow within the backend from receiving a query to
!    sending the results.
    </para>
  
    <sect1 id="query-path">
--- 17,31 ----
  
    <para>
     This chapter gives an overview of the internal structure of the
!    backend of <productname>PostgreSQL</productname>.  After having
!    read the following sections you should have an idea of how a query
!    is processed. This chapter does not aim to provide a detailed
!    description of the internal operation of
!    <productname>PostgreSQL</productname>, as such a document would be
!    very extensive. Rather, this chapter is intended to help the reader
!    understand the general sequence of operations that occur within the
!    backend from the point at which a query is received, to the point
!    when the results are returned to the client.
    </para>
  
    <sect1 id="query-path">
***************
*** 118,140 ****
     <title>How Connections are Established</title>
  
     <para>
!     <productname>PostgreSQL</productname> is implemented using a simple "process per-user"
!     client/server model.  In this model there is one <firstterm>client process</firstterm>
!     connected to exactly one <firstterm>server process</firstterm>.
!     As we don't know <foreignphrase>per se</foreignphrase> 
!     how many connections will be made, we have to use a <firstterm>master process</firstterm>
!     that spawns a new server process every time a connection is
!     requested. This master process is called <literal>postmaster</literal> and 
!     listens at a specified TCP/IP port for incoming connections. Whenever
!     a request for a connection is detected the <literal>postmaster</literal> process
!     spawns a new server process called <literal>postgres</literal>. The server
!     tasks (<literal>postgres</literal> processes) communicate with each other using
!     <firstterm>semaphores</firstterm> and <firstterm>shared memory</firstterm>
!     to ensure data integrity
!     throughout concurrent data access. Figure
!     \ref{connection} illustrates the interaction of the master process 
!     <literal>postmaster</literal> the server process <literal>postgres</literal> and a client
!     application. 
     </para>
  
     <para>
--- 118,142 ----
     <title>How Connections are Established</title>
  
     <para>
!     <productname>PostgreSQL</productname> is implemented using a
!     simple "process per-user" client/server model.  In this model
!     there is one <firstterm>client process</firstterm> connected to
!     exactly one <firstterm>server process</firstterm>.  As we do not
!     know ahead of time how many connections will be made, we have to
!     use a <firstterm>master process</firstterm> that spawns a new
!     server process every time a connection is requested. This master
!     process is called <literal>postmaster</literal> and listens at a
!     specified TCP/IP port for incoming connections. Whenever a request
!     for a connection is detected the <literal>postmaster</literal>
!     process spawns a new server process called
!     <literal>postgres</literal>. The server tasks
!     (<literal>postgres</literal> processes) communicate with each
!     other using <firstterm>semaphores</firstterm> and
!     <firstterm>shared memory</firstterm> to ensure data integrity
!     throughout concurrent data access. Figure \ref{connection}
!     illustrates the interaction of the master process
!     <literal>postmaster</literal> the server process
!     <literal>postgres</literal> and a client application.
     </para>
  
     <para>
***************
*** 686,692 ****
       for the <literal>varno</literal> fields in the
       <literal>VAR</literal> nodes appearing in the <literal>mergeclauses</literal> list (and also in the
       <literal>targetlist</literal>) mean that not the tuples of the current node should be
!      considered but the tuples of the next "deeper" nodes (i.e. the top
       nodes of the subplans) should be used instead.
      </para>
  
--- 688,694 ----
       for the <literal>varno</literal> fields in the
       <literal>VAR</literal> nodes appearing in the <literal>mergeclauses</literal> list (and also in the
       <literal>targetlist</literal>) mean that not the tuples of the current node should be
!      considered but the tuples of the next <quote>deeper</quote> nodes (i.e. the top
       nodes of the subplans) should be used instead.
      </para>
  
Index: doc/src/sgml/datatype.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/datatype.sgml,v
retrieving revision 1.113
diff -c -r1.113 datatype.sgml
*** doc/src/sgml/datatype.sgml	31 Jan 2003 01:08:07 -0000	1.113
--- doc/src/sgml/datatype.sgml	18 Feb 2003 02:16:48 -0000
***************
*** 895,901 ****
      actual string, and in case of <type>character</type> plus the
      padding. Long strings are compressed by the system automatically, so
      the physical requirement on disk may be less. Long values are also
!     stored in background tables so they don't interfere with rapid
      access to the shorter column values. In any case, the longest
      possible character string that can be stored is about 1 GB. (The
      maximum value that will be allowed for <replaceable>n</> in the data
--- 895,901 ----
      actual string, and in case of <type>character</type> plus the
      padding. Long strings are compressed by the system automatically, so
      the physical requirement on disk may be less. Long values are also
!     stored in background tables so they do not interfere with rapid
      access to the shorter column values. In any case, the longest
      possible character string that can be stored is about 1 GB. (The
      maximum value that will be allowed for <replaceable>n</> in the data
Index: doc/src/sgml/ddl.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ddl.sgml,v
retrieving revision 1.10
diff -c -r1.10 ddl.sgml
*** doc/src/sgml/ddl.sgml	15 Nov 2002 03:11:15 -0000	1.10
--- doc/src/sgml/ddl.sgml	18 Feb 2003 02:18:00 -0000
***************
*** 115,122 ****
    </para>
  
    <para>
!    If you don't need a table anymore, you can remove it using the
!    <literal>DROP TABLE</literal> command.  For example:
  <programlisting>
  DROP TABLE my_first_table;
  DROP TABLE products;
--- 115,122 ----
    </para>
  
    <para>
!    If you no longer need a table, you can remove it using the
!    <command>DROP TABLE</command> command.  For example:
  <programlisting>
  DROP TABLE my_first_table;
  DROP TABLE products;
***************
*** 718,724 ****
  
     <para>
      We know that the foreign keys disallow creation of orders that
!     don't relate to any products.  But what if a product is removed
      after an order is created that references it?  SQL allows you to
      specify that as well.  Intuitively, we have a few options:
      <itemizedlist spacing="compact">
--- 718,724 ----
  
     <para>
      We know that the foreign keys disallow creation of orders that
!     do not relate to any products.  But what if a product is removed
      after an order is created that references it?  SQL allows you to
      specify that as well.  Intuitively, we have a few options:
      <itemizedlist spacing="compact">
***************
*** 759,765 ****
     <para>
      Restricting and cascading deletes are the two most common options.
      <literal>RESTRICT</literal> can also be written as <literal>NO
!     ACTION</literal> and it's also the default if you don't specify
      anything.  There are two other options for what should happen with
      the foreign key columns when a primary key is deleted:
      <literal>SET NULL</literal> and <literal>SET DEFAULT</literal>.
--- 759,765 ----
     <para>
      Restricting and cascading deletes are the two most common options.
      <literal>RESTRICT</literal> can also be written as <literal>NO
!     ACTION</literal> and it's also the default if you do not specify
      anything.  There are two other options for what should happen with
      the foreign key columns when a primary key is deleted:
      <literal>SET NULL</literal> and <literal>SET DEFAULT</literal>.
***************
*** 1602,1608 ****
     <para>
      In the SQL standard, the notion of objects in the same schema
      being owned by different users does not exist.  Moreover, some
!     implementations don't allow you to create schemas that have a
      different name than their owner.  In fact, the concepts of schema
      and user are nearly equivalent in a database system that
      implements only the basic schema support specified in the
--- 1602,1608 ----
     <para>
      In the SQL standard, the notion of objects in the same schema
      being owned by different users does not exist.  Moreover, some
!     implementations do not allow you to create schemas that have a
      different name than their owner.  In fact, the concepts of schema
      and user are nearly equivalent in a database system that
      implements only the basic schema support specified in the
***************
*** 1686,1692 ****
  ERROR:  Cannot drop table products because other objects depend on it
          Use DROP ... CASCADE to drop the dependent objects too
  </screen>
!    The error message contains a useful hint: If you don't want to
     bother deleting all the dependent objects individually, you can run
  <screen>
  DROP TABLE products CASCADE;
--- 1686,1692 ----
  ERROR:  Cannot drop table products because other objects depend on it
          Use DROP ... CASCADE to drop the dependent objects too
  </screen>
!    The error message contains a useful hint: if you do not want to
     bother deleting all the dependent objects individually, you can run
  <screen>
  DROP TABLE products CASCADE;
Index: doc/src/sgml/docguide.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/docguide.sgml,v
retrieving revision 1.42
diff -c -r1.42 docguide.sgml
*** doc/src/sgml/docguide.sgml	28 Jul 2002 15:22:20 -0000	1.42
--- doc/src/sgml/docguide.sgml	18 Feb 2003 02:18:17 -0000
***************
*** 1327,1333 ****
        <listitem>
         <para>
          If the program uses 0 for success and non-zero for failure,
!         then you don't need to document it.  If there is a meaning
          behind the different non-zero exit codes, list them here.
         </para>
        </listitem>
--- 1327,1333 ----
        <listitem>
         <para>
          If the program uses 0 for success and non-zero for failure,
!         then you do not need to document it.  If there is a meaning
          behind the different non-zero exit codes, list them here.
         </para>
        </listitem>
Index: doc/src/sgml/mvcc.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/mvcc.sgml,v
retrieving revision 2.32
diff -c -r2.32 mvcc.sgml
*** doc/src/sgml/mvcc.sgml	11 Jan 2003 00:00:02 -0000	2.32
--- doc/src/sgml/mvcc.sgml	18 Feb 2003 02:19:00 -0000
***************
*** 38,46 ****
     </para>
  
     <para>
!     The main difference between multiversion and lock models is that
!     in <acronym>MVCC</acronym> locks acquired for querying (reading)
!     data don't conflict with locks acquired for writing data, and so
      reading never blocks writing and writing never blocks reading.
     </para>
  
--- 38,47 ----
     </para>
  
     <para>
!     The main advantage to using the <acronym>MVCC</acronym> model of
!     concurrency control rather than locking is that in
!     <acronym>MVCC</acronym> locks acquired for querying (reading) data
!     do not conflict with locks acquired for writing data, and so
      reading never blocks writing and writing never blocks reading.
     </para>
  
***************
*** 437,446 ****
  	</para>
  
  	<para>
! 	 The <command>SELECT</command> command acquires a
! 	 lock of this mode on referenced tables.  In general, any query
! 	 that only reads a table and does not modify it will acquire
! 	 this lock mode.
  	</para>
         </listitem>
        </varlistentry>
--- 438,447 ----
  	</para>
  
  	<para>
! 	 The commands <command>SELECT</command> and
! 	 <command>ANALYZE</command> acquire a lock of this mode on
! 	 referenced tables.  In general, any query that only reads a table
! 	 and does not modify it will acquire this lock mode.
  	</para>
         </listitem>
        </varlistentry>
***************
*** 586,594 ****
  
  	<para>
  	 Acquired by the <command>ALTER TABLE</command>, <command>DROP
! 	 TABLE</command>, and <command>VACUUM FULL</command> commands.
! 	 This is also the default lock mode for <command>LOCK TABLE</command>
!          statements that do not specify a mode explicitly.
  	</para>
         </listitem>
        </varlistentry>
--- 587,596 ----
  
  	<para>
  	 Acquired by the <command>ALTER TABLE</command>, <command>DROP
! 	 TABLE</command>, <command>REINDEX</command>,
! 	 <command>CLUSTER</command>, and <command>VACUUM FULL</command>
! 	 commands.  This is also the default lock mode for <command>LOCK
! 	 TABLE</command> statements that do not specify a mode explicitly.
  	</para>
         </listitem>
        </varlistentry>
***************
*** 612,618 ****
       A row-level lock on a specific row is automatically acquired when the
       row is updated (or deleted or marked for update).  The lock is held
       until the transaction commits or rolls back.
!      Row-level locks don't affect data
       querying; they block <emphasis>writers to the same row</emphasis>
       only.  To acquire a row-level lock on a row without actually
       modifying the row, select the row with <command>SELECT FOR
--- 614,620 ----
       A row-level lock on a specific row is automatically acquired when the
       row is updated (or deleted or marked for update).  The lock is held
       until the transaction commits or rolls back.
!      Row-level locks do not affect data
       querying; they block <emphasis>writers to the same row</emphasis>
       only.  To acquire a row-level lock on a row without actually
       modifying the row, select the row with <command>SELECT FOR
***************
*** 726,732 ****
  
     <para>
      Because readers in <productname>PostgreSQL</productname>
!     don't lock data, regardless of
      transaction isolation level, data read by one transaction can be
      overwritten by another concurrent transaction. In other words,
      if a row is returned by <command>SELECT</command> it doesn't mean that
--- 728,734 ----
  
     <para>
      Because readers in <productname>PostgreSQL</productname>
!     do not lock data, regardless of
      transaction isolation level, data read by one transaction can be
      overwritten by another concurrent transaction. In other words,
      if a row is returned by <command>SELECT</command> it doesn't mean that
Index: doc/src/sgml/page.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/page.sgml,v
retrieving revision 1.12
diff -c -r1.12 page.sgml
*** doc/src/sgml/page.sgml	2 Sep 2002 01:05:03 -0000	1.12
--- doc/src/sgml/page.sgml	18 Feb 2003 02:27:06 -0000
***************
*** 196,204 ****
   
   <para>
   
!   The final section is the "special section" which may contain anything the
!   access method wishes to store. Ordinary tables do not use this at all
!   (indicated by setting <structfield>pd_special</> to equal the pagesize).
    
   </para>
   
--- 196,205 ----
   
   <para>
   
!   The final section is the <quote>special section</quote> which may
!   contain anything the access method wishes to store. Ordinary tables
!   do not use this at all (indicated by setting
!   <structfield>pd_special</> to equal the pagesize).
    
   </para>
   
Index: doc/src/sgml/plpgsql.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/plpgsql.sgml,v
retrieving revision 1.14
diff -c -r1.14 plpgsql.sgml
*** doc/src/sgml/plpgsql.sgml	19 Jan 2003 00:13:28 -0000	1.14
--- doc/src/sgml/plpgsql.sgml	18 Feb 2003 02:19:30 -0000
***************
*** 578,584 ****
          </para>
  
          <para>
!          By using <type>%TYPE</type> you don't need to know
           the data type of the structure you are referencing,
           and most important, if the data type of the
           referenced item changes in the future (e.g: you
--- 578,584 ----
          </para>
  
          <para>
!          By using <type>%TYPE</type> you do not need to know
           the data type of the structure you are referencing,
           and most important, if the data type of the
           referenced item changes in the future (e.g: you
***************
*** 1649,1655 ****
      up a <firstterm>cursor</> that encapsulates the query, and then read
      the query result a few rows at a time. One reason for doing this is
      to avoid memory overrun when the result contains a large number of
!     rows. (However, <application>PL/pgSQL</> users don't normally need
      to worry about that, since FOR loops automatically use a cursor
      internally to avoid memory problems.) A more interesting usage is to
      return a reference to a cursor that it has created, allowing the
--- 1649,1655 ----
      up a <firstterm>cursor</> that encapsulates the query, and then read
      the query result a few rows at a time. One reason for doing this is
      to avoid memory overrun when the result contains a large number of
!     rows. (However, <application>PL/pgSQL</> users do not normally need
      to worry about that, since FOR loops automatically use a cursor
      internally to avoid memory problems.) A more interesting usage is to
      return a reference to a cursor that it has created, allowing the
Index: doc/src/sgml/runtime.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/runtime.sgml,v
retrieving revision 1.168
diff -c -r1.168 runtime.sgml
*** doc/src/sgml/runtime.sgml	6 Feb 2003 20:25:31 -0000	1.168
--- doc/src/sgml/runtime.sgml	18 Feb 2003 02:21:12 -0000
***************
*** 122,128 ****
    <para>
     However, while the directory contents are secure, the default
     client authentication setup allows any local user to connect to the
!    database and even become the database superuser. If you don't trust
     other local users, we recommend you use <command>initdb</command>'s
     <option>-W</option> or <option>--pwprompt</option> option to assign a
     password to the database superuser. After <command>initdb</command>,
--- 122,128 ----
    <para>
     However, while the directory contents are secure, the default
     client authentication setup allows any local user to connect to the
!    database and even become the database superuser. If you do not trust
     other local users, we recommend you use <command>initdb</command>'s
     <option>-W</option> or <option>--pwprompt</option> option to assign a
     password to the database superuser. After <command>initdb</command>,
***************
*** 365,371 ****
       probably means your kernel's limit on the size of shared memory is
       smaller than the buffer area <productname>PostgreSQL</productname>
       is trying to create (83918612 bytes in this example). Or it could
!      mean that you don't have System-V-style shared memory support
       configured into your kernel at all. As a temporary workaround, you
       can try starting the postmaster with a smaller-than-normal number
       of buffers (<option>-B</option> switch). You will eventually want
--- 365,371 ----
       probably means your kernel's limit on the size of shared memory is
       smaller than the buffer area <productname>PostgreSQL</productname>
       is trying to create (83918612 bytes in this example). Or it could
!      mean that you do not have System-V-style shared memory support
       configured into your kernel at all. As a temporary workaround, you
       can try starting the postmaster with a smaller-than-normal number
       of buffers (<option>-B</option> switch). You will eventually want
***************
*** 2937,2943 ****
      On the other side of the coin, some systems allow individual
      processes to open large numbers of files; if more than a few
      processes do so then the system-wide limit can easily be exceeded.
!     If you find this happening, and don't want to alter the system-wide
      limit, you can set <productname>PostgreSQL</productname>'s
      <varname>max_files_per_process</varname> configuration parameter to
      limit the consumption of open files.
--- 2937,2943 ----
      On the other side of the coin, some systems allow individual
      processes to open large numbers of files; if more than a few
      processes do so then the system-wide limit can easily be exceeded.
!     If you find this happening, and you do not want to alter the system-wide
      limit, you can set <productname>PostgreSQL</productname>'s
      <varname>max_files_per_process</varname> configuration parameter to
      limit the consumption of open files.
Index: doc/src/sgml/sql.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/sql.sgml,v
retrieving revision 1.28
diff -c -r1.28 sql.sgml
*** doc/src/sgml/sql.sgml	15 Jan 2003 18:01:05 -0000	1.28
--- doc/src/sgml/sql.sgml	18 Feb 2003 02:33:25 -0000
***************
*** 24,30 ****
    <para>
     <acronym>SQL</acronym> has become the most popular relational query 
     language.
!    The name "<acronym>SQL</acronym>" is an abbreviation for
     <firstterm>Structured Query Language</firstterm>. 
     In 1974 Donald Chamberlin and others defined the
     language SEQUEL (<firstterm>Structured English Query
--- 24,30 ----
    <para>
     <acronym>SQL</acronym> has become the most popular relational query 
     language.
!    The name <quote><acronym>SQL</acronym></quote> is an abbreviation for
     <firstterm>Structured Query Language</firstterm>. 
     In 1974 Donald Chamberlin and others defined the
     language SEQUEL (<firstterm>Structured English Query
***************
*** 72,81 ****
     (<acronym>ISO</acronym>).
     This original standard version of <acronym>SQL</acronym> is often
     referred to,
!    informally, as "<abbrev>SQL/86</abbrev>". In 1989 the original
     standard was extended
     and this new standard is often, again informally, referred to as
!    "<abbrev>SQL/89</abbrev>". Also in 1989, a related standard called
     <firstterm>Database Language Embedded <acronym>SQL</acronym></firstterm>
     (<acronym>ESQL</acronym>) was developed.
    </para>
--- 72,81 ----
     (<acronym>ISO</acronym>).
     This original standard version of <acronym>SQL</acronym> is often
     referred to,
!    informally, as <quote><abbrev>SQL/86</abbrev></quote>. In 1989 the original
     standard was extended
     and this new standard is often, again informally, referred to as
!    <quote><abbrev>SQL/89</abbrev></quote>. Also in 1989, a related standard called
     <firstterm>Database Language Embedded <acronym>SQL</acronym></firstterm>
     (<acronym>ESQL</acronym>) was developed.
    </para>
***************
*** 86,96 ****
     definition of a greatly expanded version of the original standard,
     referred to informally as <firstterm><acronym>SQL2</acronym></firstterm>
     or <firstterm><acronym>SQL/92</acronym></firstterm>. This version became a
!    ratified standard - "International Standard ISO/IEC 9075:1992,
!    Database Language <acronym>SQL</acronym>" - in late 1992.
     <acronym>SQL/92</acronym> is the version
!    normally meant when people refer to "the <acronym>SQL</acronym>
!    standard". A detailed
     description of <acronym>SQL/92</acronym> is given in 
     <xref linkend="DATE97" endterm="DATE97">. At the time of
     writing this document a new standard informally referred to
--- 86,96 ----
     definition of a greatly expanded version of the original standard,
     referred to informally as <firstterm><acronym>SQL2</acronym></firstterm>
     or <firstterm><acronym>SQL/92</acronym></firstterm>. This version became a
!    ratified standard - <quote>International Standard ISO/IEC 9075:1992,
!    Database Language <acronym>SQL</acronym></quote> - in late 1992.
     <acronym>SQL/92</acronym> is the version
!    normally meant when people refer to <quote>the <acronym>SQL</acronym>
!    standard</quote>. A detailed
     description of <acronym>SQL/92</acronym> is given in 
     <xref linkend="DATE97" endterm="DATE97">. At the time of
     writing this document a new standard informally referred to
***************
*** 768,775 ****
       can be formulated using relational algebra can also be formulated 
       using the relational calculus and vice versa.
       This was first proved by E. F. Codd in
!      1972. This proof is based on an algorithm ("Codd's reduction
!      algorithm") by which an arbitrary expression of the relational
       calculus can be reduced to a semantically equivalent expression of
       relational algebra. For a more detailed discussion on that refer to
       <xref linkend="DATE94" endterm="DATE94">
--- 768,775 ----
       can be formulated using relational algebra can also be formulated 
       using the relational calculus and vice versa.
       This was first proved by E. F. Codd in
!      1972. This proof is based on an algorithm (<quote>Codd's reduction
!      algorithm</quote>) by which an arbitrary expression of the relational
       calculus can be reduced to a semantically equivalent expression of
       relational algebra. For a more detailed discussion on that refer to
       <xref linkend="DATE94" endterm="DATE94">
***************
*** 778,788 ****
      </para>
  
      <para>
!      It is sometimes said that languages based on the relational calculus
!      are "higher level" or "more declarative" than languages based on
!      relational algebra because the algebra (partially) specifies the order
!      of operations while the calculus leaves it to a compiler or
!      interpreter to determine the most efficient order of evaluation.
      </para>
     </sect2>
    </sect1>
--- 778,789 ----
      </para>
  
      <para>
!      It is sometimes said that languages based on the relational
!      calculus are <quote>higher level</quote> or <quote>more
!      declarative</quote> than languages based on relational algebra
!      because the algebra (partially) specifies the order of operations
!      while the calculus leaves it to a compiler or interpreter to
!      determine the most efficient order of evaluation.
      </para>
     </sect2>
    </sect1>
***************
*** 870,878 ****
      </para>
  
      <para>
!      Now we will illustrate the complex syntax of the SELECT statement
!      with various examples. The tables used for the examples are defined in
!      <xref linkend="supplier-fig" endterm="supplier-fig">.
      </para>
  
      <sect3>
--- 871,880 ----
      </para>
  
      <para>
!      Now we will illustrate the complex syntax of the
!      <command>SELECT</command> statement with various examples. The
!      tables used for the examples are defined in <xref
!      linkend="supplier-fig" endterm="supplier-fig">.
      </para>
  
      <sect3>
***************
*** 903,909 ****
         </para>
  
         <para>
! 	Using "*" in the SELECT statement will deliver all attributes from
  	the table. If we want to retrieve only the attributes PNAME and PRICE
  	from table PART we use the statement:
  
--- 905,911 ----
         </para>
  
         <para>
! 	Using <quote>*</quote> in the SELECT statement will deliver all attributes from
  	the table. If we want to retrieve only the attributes PNAME and PRICE
  	from table PART we use the statement:
  
***************
*** 922,930 ****
                        Cam    |   25
  	</programlisting>
  
! 	Note that the <acronym>SQL</acronym> SELECT corresponds to the 
! 	"projection" in relational algebra not to the "selection"
! 	(see <xref linkend="rel-alg" endterm="rel-alg"> for more details).
         </para>
  
         <para>
--- 924,933 ----
                        Cam    |   25
  	</programlisting>
  
! 	Note that the <acronym>SQL</acronym> SELECT corresponds to the
! 	<quote>projection</quote> in relational algebra not to the
! 	<quote>selection</quote> (see <xref linkend="rel-alg"
! 	endterm="rel-alg"> for more details).
         </para>
  
         <para>
Index: doc/src/sgml/start.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/start.sgml,v
retrieving revision 1.27
diff -c -r1.27 start.sgml
*** doc/src/sgml/start.sgml	11 Nov 2002 20:14:04 -0000	1.27
--- doc/src/sgml/start.sgml	18 Feb 2003 02:22:50 -0000
***************
*** 242,248 ****
     </para>
  
     <para>
!     If you don't want to use your database anymore you can remove it.
      For example, if you are the owner (creator) of the database
      <literal>mydb</literal>, you can destroy it using the following
      command:
--- 242,248 ----
     </para>
  
     <para>
!     If you do not want to use your database anymore you can remove it.
      For example, if you are the owner (creator) of the database
      <literal>mydb</literal>, you can destroy it using the following
      command:
Index: doc/src/sgml/typeconv.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/typeconv.sgml,v
retrieving revision 1.25
diff -c -r1.25 typeconv.sgml
*** doc/src/sgml/typeconv.sgml	11 Nov 2002 20:14:04 -0000	1.25
--- doc/src/sgml/typeconv.sgml	18 Feb 2003 02:26:38 -0000
***************
*** 305,311 ****
  <para>
  If any input arguments are <quote>unknown</quote>, check the type
  categories accepted at those argument positions by the remaining
! candidates.  At each position, select the "string" category if any
  candidate accepts that category (this bias towards string is appropriate
  since an unknown-type literal does look like a string). Otherwise, if
  all the remaining candidates accept the same type category, select that
--- 305,311 ----
  <para>
  If any input arguments are <quote>unknown</quote>, check the type
  categories accepted at those argument positions by the remaining
! candidates.  At each position, select the <quote>string</quote> category if any
  candidate accepts that category (this bias towards string is appropriate
  since an unknown-type literal does look like a string). Otherwise, if
  all the remaining candidates accept the same type category, select that
Index: doc/src/sgml/xfunc.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/xfunc.sgml,v
retrieving revision 1.64
diff -c -r1.64 xfunc.sgml
*** doc/src/sgml/xfunc.sgml	19 Jan 2003 00:13:28 -0000	1.64
--- doc/src/sgml/xfunc.sgml	18 Feb 2003 02:26:09 -0000
***************
*** 606,612 ****
      The newer <quote>version 1</quote> calling convention is indicated by writing
      a <literal>PG_FUNCTION_INFO_V1()</literal> macro call for the function,
      as illustrated below.  Lack of such a macro indicates an old-style
!     ("version 0") function.  The language name specified in <command>CREATE FUNCTION</command>
      is <literal>C</literal> in either case.  Old-style functions are now deprecated
      because of portability problems and lack of functionality, but they
      are still supported for compatibility reasons.
--- 606,612 ----
      The newer <quote>version 1</quote> calling convention is indicated by writing
      a <literal>PG_FUNCTION_INFO_V1()</literal> macro call for the function,
      as illustrated below.  Lack of such a macro indicates an old-style
!     (<quote>version 0</quote>) function.  The language name specified in <command>CREATE FUNCTION</command>
      is <literal>C</literal> in either case.  Old-style functions are now deprecated
      because of portability problems and lack of functionality, but they
      are still supported for compatibility reasons.
***************
*** 1380,1386 ****
      zero, and a negative length requests that the remainder of the
      value be returned. These routines provide more efficient access to
      parts of large values in the case where they have storage type
!     "external". (The storage type of a column can be specified using
      <literal>ALTER TABLE <replaceable>tablename</replaceable> ALTER
      COLUMN <replaceable>colname</replaceable> SET STORAGE
      <replaceable>storagetype</replaceable></literal>. Storage type is one of
--- 1380,1386 ----
      zero, and a negative length requests that the remainder of the
      value be returned. These routines provide more efficient access to
      parts of large values in the case where they have storage type
!     <quote>external</quote>. (The storage type of a column can be specified using
      <literal>ALTER TABLE <replaceable>tablename</replaceable> ALTER
      COLUMN <replaceable>colname</replaceable> SET STORAGE
      <replaceable>storagetype</replaceable></literal>. Storage type is one of
***************
*** 1583,1589 ****
  HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
  </programlisting>
       can be used to build a <structname>HeapTuple</> given user data
!      in C string form.  "values" is an array of C strings, one for
       each attribute of the return tuple. Each C string should be in
       the form expected by the input function of the attribute data
       type. In order to return a null value for one of the attributes,
--- 1583,1589 ----
  HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
  </programlisting>
       can be used to build a <structname>HeapTuple</> given user data
!      in C string form.  <quote>values</quote> is an array of C strings, one for
       each attribute of the return tuple. Each C string should be in
       the form expected by the input function of the attribute data
       type. In order to return a null value for one of the attributes,
Index: doc/src/sgml/ref/alter_table.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ref/alter_table.sgml,v
retrieving revision 1.55
diff -c -r1.55 alter_table.sgml
*** doc/src/sgml/ref/alter_table.sgml	13 Feb 2003 05:19:59 -0000	1.55
--- doc/src/sgml/ref/alter_table.sgml	18 Feb 2003 02:00:26 -0000
***************
*** 367,373 ****
      default and NOT NULL clauses for the new column are not supported.
      The new column always comes into being with all values NULL.
      You can use the <literal>SET DEFAULT</literal> form
!     of <command>ALTER TABLE</command> to set the default afterwards.
      (You may also want to update the already existing rows to the
      new default value, using
      <xref linkend="sql-update" endterm="sql-update-title">.)
--- 367,373 ----
      default and NOT NULL clauses for the new column are not supported.
      The new column always comes into being with all values NULL.
      You can use the <literal>SET DEFAULT</literal> form
!     of <command>ALTER TABLE</command> to set the default afterward.
      (You may also want to update the already existing rows to the
      new default value, using
      <xref linkend="sql-update" endterm="sql-update-title">.)
***************
*** 392,410 ****
     </para>
  
     <para>
!     If a table has any descendant tables, it is not permitted to ADD or
!     RENAME a column in the parent table without doing the same to the
!     descendants --- that is, ALTER TABLE ONLY will be rejected.  This
!     ensures that the descendants always have columns matching the parent.
     </para>
  
     <para>
!     A recursive DROP COLUMN operation will remove a descendant table's column
!     only if the descendant does not inherit that column from any other
!     parents and never had an independent definition of the column.
!     A nonrecursive DROP COLUMN (i.e., ALTER TABLE ONLY ... DROP COLUMN)
!     never removes any descendant columns, but instead marks them as
!     independently defined rather than inherited.
     </para>
  
     <para>
--- 392,412 ----
     </para>
  
     <para>
!     If a table has any descendant tables, it is not permitted to ADD
!     or RENAME a column in the parent table without doing the same to
!     the descendants --- that is, <command>ALTER TABLE ONLY</command>
!     will be rejected.  This ensures that the descendants always have
!     columns matching the parent.
     </para>
  
     <para>
!     A recursive <literal>DROP COLUMN</literal> operation will remove a
!     descendant table's column only if the descendant does not inherit
!     that column from any other parents and never had an independent
!     definition of the column.  A nonrecursive <literal>DROP
!     COLUMN</literal> (i.e., <command>ALTER TABLE ONLY ... DROP
!     COLUMN</command>) never removes any descendant columns, but
!     instead marks them as independently defined rather than inherited.
     </para>
  
     <para>
Index: doc/src/sgml/ref/cluster.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ref/cluster.sgml,v
retrieving revision 1.23
diff -c -r1.23 cluster.sgml
*** doc/src/sgml/ref/cluster.sgml	30 Dec 2002 18:42:12 -0000	1.23
--- doc/src/sgml/ref/cluster.sgml	18 Feb 2003 02:03:14 -0000
***************
*** 117,127 ****
     <command>CLUSTER</command> without any parameter re-clusters all the tables
     in the
     current database that the calling user owns, or all tables if called
!    by a superuser.  (Never-clustered tables are not touched.)  This
     form of <command>CLUSTER</command> cannot be called from inside a
     transaction or function.
    </para>
  
    <refsect2 id="R2-SQL-CLUSTER-3">
     <refsect2info>
      <date>1998-09-08</date>
--- 117,135 ----
     <command>CLUSTER</command> without any parameter re-clusters all the tables
     in the
     current database that the calling user owns, or all tables if called
!    by a superuser.  (Never-clustered tables are not included.)  This
     form of <command>CLUSTER</command> cannot be called from inside a
     transaction or function.
    </para>
  
+   <para>
+    When a table is being clustered, an <literal>ACCESS
+    EXCLUSIVE</literal> lock is acquired on it. This prevents any other
+    database operations (both reads and writes) from preceding on the
+    table until the <command>CLUSTER</command> is finished. See the
+    &cite-user; for more information on database locking.
+   </para>
+ 
    <refsect2 id="R2-SQL-CLUSTER-3">
     <refsect2info>
      <date>1998-09-08</date>
***************
*** 159,166 ****
     </para>
  
     <para>
!     <command>CLUSTER</command> preserves GRANT, inheritance, index, foreign
!     key, and other ancillary information about the table.
     </para>
  
     <para>
--- 167,175 ----
     </para>
  
     <para>
!     <command>CLUSTER</command> preserves <command>GRANT</command>,
!     inheritance, index, foreign key, and other ancillary information
!     about the table.
     </para>
  
     <para>
***************
*** 212,224 ****
     Usage
    </title>
    <para>
!    Cluster the employees relation on the basis of its ID attribute:
    </para>
    <programlisting>
  CLUSTER emp_ind ON emp;
    </programlisting>
    <para>
!    Cluster the employees relation using the same index that was used before:
    </para>
    <programlisting>
  CLUSTER emp;
--- 221,235 ----
     Usage
    </title>
    <para>
!    Cluster the <literal>employees</literal> relation on the basis of
!    its ID attribute:
    </para>
    <programlisting>
  CLUSTER emp_ind ON emp;
    </programlisting>
    <para>
!    Cluster the <literal>employees</literal> relation using the same
!    index that was used before:
    </para>
    <programlisting>
  CLUSTER emp;
***************
*** 247,252 ****
--- 258,271 ----
      There is no <command>CLUSTER</command> statement in SQL92.
     </para>
    </refsect2>
+  </refsect1>
+ 
+  <refsect1>
+   <title>See Also</title>
+ 
+   <simplelist type="inline">
+    <member><xref linkend="app-clusterdb" endterm="app-clusterdb-title"></member>
+   </simplelist>
   </refsect1>
  </refentry>
  
Index: doc/src/sgml/ref/clusterdb.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ref/clusterdb.sgml,v
retrieving revision 1.6
diff -c -r1.6 clusterdb.sgml
*** doc/src/sgml/ref/clusterdb.sgml	13 Feb 2003 05:37:43 -0000	1.6
--- doc/src/sgml/ref/clusterdb.sgml	18 Feb 2003 02:10:43 -0000
***************
*** 37,43 ****
     in a <productname>PostgreSQL</productname> database.  It finds tables
     that have previously been clustered, and clusters them again on the same
     index that was last used.  Tables that have never been clustered are not
!    touched.
    </para>
  
    <para>
--- 37,43 ----
     in a <productname>PostgreSQL</productname> database.  It finds tables
     that have previously been clustered, and clusters them again on the same
     index that was last used.  Tables that have never been clustered are not
!    affected.
    </para>
  
    <para>
Index: doc/src/sgml/ref/reindex.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ref/reindex.sgml,v
retrieving revision 1.14
diff -c -r1.14 reindex.sgml
*** doc/src/sgml/ref/reindex.sgml	17 Nov 2002 23:43:32 -0000	1.14
--- doc/src/sgml/ref/reindex.sgml	18 Feb 2003 01:34:32 -0000
***************
*** 38,45 ****
        <term>DATABASE</term>
        <listitem>
         <para>
! 	Recreate all system indexes of a specified database.
! 	(User-table indexes are not included.)
         </para>
        </listitem>
       </varlistentry>
--- 38,46 ----
        <term>DATABASE</term>
        <listitem>
         <para>
! 	Recreate all system indexes of a specified database. Indexes on
! 	user tables are not included. This form of <command>REINDEX</> can
! 	only be used in standalone mode (see below).
         </para>
        </listitem>
       </varlistentry>
***************
*** 116,131 ****
     Description
    </title>
    <para>
!    <command>REINDEX</command> is used to rebuild corrupted indexes.
!    Although in theory this should never be necessary, in practice
!    indexes may become corrupted due to software bugs or hardware
!    failures.  <command>REINDEX</command> provides a recovery method.
!   </para>
  
!   <para>
!    <command>REINDEX</command> also removes certain dead index pages that
!    can't be reclaimed any other way. See the "Routine Reindexing"
!    section in the manual for more information.
    </para>
  
    <para>
--- 117,151 ----
     Description
    </title>
    <para>
!    <command>REINDEX</command> rebuilds an index based on the data
!    stored in the table, replacing the old copy of the index. There are
!    two main reasons to use <command>REINDEX</command>:
  
!    <orderedlist>
!     <listitem>
!      <para>
!       An index has become corrupted, and no longer contains valid
!       data. Although in theory this should never be necessary, in
!       practice indexes may become corrupted due to software bugs or
!       hardware failures.  <command>REINDEX</command> provides a
!       recovery method.
!      </para>
!     </listitem>
! 
!     <listitem>
!      <para>
!       The index in question contains a lot of dead index pages that
!       are not being reclaimed. This can occur with B+-tree indexes
!       under certain access patterns. <command>REINDEX</command>
!       provides a way to reduce the space consumption of the index by
!       writing a new version of the index without the dead pages. See
!       the <quote>Routine Reindexing</quote> section in the
!       &cite-admin; for more information. The rest of this section
!       mostly discusses how to use <command>REINDEX</command> to
!       recover from index corruption.
!      </para>
!     </listitem>
!    </orderedlist>
    </para>
  
    <para>
Index: doc/src/sgml/ref/set_session_auth.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ref/set_session_auth.sgml,v
retrieving revision 1.7
diff -c -r1.7 set_session_auth.sgml
*** doc/src/sgml/ref/set_session_auth.sgml	21 Sep 2002 18:32:54 -0000	1.7
--- doc/src/sgml/ref/set_session_auth.sgml	18 Feb 2003 01:43:45 -0000
***************
*** 16,22 ****
  
   <refsynopsisdiv>
  <synopsis>
! SET [ SESSION | LOCAL ] SESSION AUTHORIZATION <parameter>username</parameter>
  SET [ SESSION | LOCAL ] SESSION AUTHORIZATION DEFAULT
  RESET SESSION AUTHORIZATION
  </synopsis>
--- 16,22 ----
  
   <refsynopsisdiv>
  <synopsis>
! SET [ SESSION | LOCAL ] SESSION AUTHORIZATION <replaceable class="PARAMETER">username</replaceable>
  SET [ SESSION | LOCAL ] SESSION AUTHORIZATION DEFAULT
  RESET SESSION AUTHORIZATION
  </synopsis>
***************
*** 27,38 ****
  
    <para>
     This command sets the session user identifier and the current user
!    identifier of the current SQL-session context to be
!    <parameter>username</parameter>.  The user name may be written as
!    either an identifier or a string literal.
!    The session user identifier is valid for the duration of a
!    connection; for example, it is possible to temporarily become an
!    unprivileged user and later switch back to become a superuser.
    </para>
  
    <para>
--- 27,38 ----
  
    <para>
     This command sets the session user identifier and the current user
!    identifier of the current SQL-session context to be <replaceable
!    class="PARAMETER">username</replaceable>.  The user name may be
!    written as either an identifier or a string literal.  The session
!    user identifier is valid for the duration of a connection; for
!    example, it is possible to temporarily become an unprivileged user
!    and later switch back to become a superuser.
    </para>
  
    <para>
***************
*** 68,86 ****
   <refsect1>
    <title>Examples</title>
  
! <screen>
! <userinput>SELECT SESSION_USER, CURRENT_USER;</userinput>
!  current_user | session_user
  --------------+--------------
   peter        | peter
  
! <userinput>SET SESSION AUTHORIZATION 'paul';</userinput>
  
! <userinput>SELECT SESSION_USER, CURRENT_USER;</userinput>
!  current_user | session_user
  --------------+--------------
   paul         | paul
! </screen>
   </refsect1>
  
   <refsect1>
--- 68,88 ----
   <refsect1>
    <title>Examples</title>
  
! <programlisting>
! SELECT SESSION_USER, CURRENT_USER;
! 
!  session_user | current_user 
  --------------+--------------
   peter        | peter
  
! SET SESSION AUTHORIZATION 'paul';
! 
! SELECT SESSION_USER, CURRENT_USER;
  
!  session_user | current_user 
  --------------+--------------
   paul         | paul
! </programlisting>
   </refsect1>
  
   <refsect1>
Index: doc/src/sgml/ref/vacuum.sgml
===================================================================
RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/ref/vacuum.sgml,v
retrieving revision 1.28
diff -c -r1.28 vacuum.sgml
*** doc/src/sgml/ref/vacuum.sgml	19 Jan 2003 00:13:31 -0000	1.28
--- doc/src/sgml/ref/vacuum.sgml	18 Feb 2003 02:03:58 -0000
***************
*** 286,291 ****
--- 286,299 ----
     </para>
    </refsect2>
   </refsect1>
+ 
+  <refsect1>
+   <title>See Also</title>
+ 
+   <simplelist type="inline">
+    <member><xref linkend="app-vacuumdb" endterm="app-vacuumdb-title"></member>
+   </simplelist>
+  </refsect1>
  </refentry>
  
  <!-- Keep this comment at the end of the file
Index: src/backend/catalog/index.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/backend/catalog/index.c,v
retrieving revision 1.208
diff -c -r1.208 index.c
*** src/backend/catalog/index.c	15 Dec 2002 16:17:38 -0000	1.208
--- src/backend/catalog/index.c	17 Feb 2003 22:14:37 -0000
***************
*** 1894,1901 ****
  
  	/*
  	 * Ensure to hold an exclusive lock throughout the transaction. The
! 	 * lock could be less intensive (in the non-overwrite path) but now
! 	 * it's AccessExclusiveLock for simplicity.
  	 */
  	rel = heap_open(relid, AccessExclusiveLock);
  
--- 1894,1901 ----
  
  	/*
  	 * Ensure to hold an exclusive lock throughout the transaction. The
! 	 * lock could be less intensive (in the non-overwrite path) but for
! 	 * now it's AccessExclusiveLock for simplicity.
  	 */
  	rel = heap_open(relid, AccessExclusiveLock);
  
