Index: doc/src/sgml/ref/alter_aggregate.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_aggregate.sgml,v
retrieving revision 1.5
diff -c -B -r1.5 alter_aggregate.sgml
*** doc/src/sgml/ref/alter_aggregate.sgml	25 Jun 2004 21:55:50 -0000	1.5
--- doc/src/sgml/ref/alter_aggregate.sgml	1 Aug 2005 14:26:24 -0000
***************
*** 22,27 ****
--- 22,28 ----
  <synopsis>
  ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>type</replaceable> ) RENAME TO <replaceable>newname</replaceable>
  ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>type</replaceable> ) OWNER TO <replaceable>newowner</replaceable>
+ ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>type</replaceable> ) SET SCHEMA <replaceable>schema_name</replaceable>
  </synopsis>
   </refsynopsisdiv>
    
***************
*** 75,80 ****
--- 76,91 ----
       </para>
      </listitem>
     </varlistentry>
+ 
+    <varlistentry>
+     <term><replaceable class="parameter">schema_name</replaceable></term>
+     <listitem>
+      <para>
+       The new schema name of the aggregate function. You must be the owner
+       of the aggregate function to change its schema.
+      </para>
+     </listitem>
+    </varlistentry>
    </variablelist>
   </refsect1>
  
***************
*** 96,101 ****
--- 107,120 ----
  ALTER AGGREGATE myavg(integer) OWNER TO joe;
  </programlisting>
    </para>
+ 
+   <para>
+    To change the schema of the aggregate function <literal>myavg</literal> for type
+    <type>integer</type> to <literal>myschema</literal>:
+ <programlisting>
+ ALTER AGGREGATE myavg(integer) SET SCHEMA myschema;
+ </programlisting>
+   </para>
   </refsect1>
  
   <refsect1>
Index: doc/src/sgml/ref/alter_domain.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_domain.sgml,v
retrieving revision 1.16
diff -c -B -r1.16 alter_domain.sgml
*** doc/src/sgml/ref/alter_domain.sgml	14 Jul 2005 06:17:36 -0000	1.16
--- doc/src/sgml/ref/alter_domain.sgml	1 Aug 2005 14:26:24 -0000
***************
*** 34,39 ****
--- 34,41 ----
      DROP CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> [ RESTRICT | CASCADE ]
  ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
      OWNER TO <replaceable class="PARAMETER">new_owner</replaceable> 
+ ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
+     SET SCHEMA <replaceable class="PARAMETER">schema_name</replaceable> 
    </synopsis>
   </refsynopsisdiv>
  
***************
*** 97,102 ****
--- 99,113 ----
       </para>
      </listitem>
     </varlistentry>
+ 
+    <varlistentry>
+     <term>SET SCHEMA</term>
+     <listitem>
+      <para>
+       This form changes the schema of the domain.
+      </para>
+     </listitem>
+    </varlistentry>
    </variablelist>
  
    <para>
***************
*** 166,171 ****
--- 177,191 ----
        </listitem>
       </varlistentry>
  
+      <varlistentry>
+       <term><replaceable class="PARAMETER">schema_name</replaceable></term>
+       <listitem>
+        <para>
+         The new schema name of the domain.
+        </para>
+       </listitem>
+      </varlistentry>
+ 
      </variablelist>
     </para>
    </refsect1>
***************
*** 197,202 ****
--- 217,229 ----
  ALTER DOMAIN zipcode DROP CONSTRAINT zipchk;
     </programlisting>
    </para>
+ 
+   <para>
+    To move the domain into a different schema <literal>customers</literal>:
+    <programlisting>
+ ALTER DOMAIN zipcode SET SCHEMA customers;
+    </programlisting>
+   </para>
   </refsect1>
  
   <refsect1 id="SQL-ALTERDOMAIN-compatibility">
Index: doc/src/sgml/ref/alter_function.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_function.sgml,v
retrieving revision 1.7
diff -c -B -r1.7 alter_function.sgml
*** doc/src/sgml/ref/alter_function.sgml	26 May 2005 20:05:03 -0000	1.7
--- doc/src/sgml/ref/alter_function.sgml	1 Aug 2005 14:26:25 -0000
***************
*** 26,31 ****
--- 26,33 ----
      RENAME TO <replaceable>newname</replaceable>
  ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
      OWNER TO <replaceable>newowner</replaceable>
+ ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
+     SET SCHEMA <replaceable>schema_name</replaceable>
  
  where <replaceable class="PARAMETER">action</replaceable> is one of:
  
***************
*** 118,123 ****
--- 120,135 ----
      </listitem>
     </varlistentry>
  
+    <varlistentry>
+     <term><replaceable class="parameter">schema_name</replaceable></term>
+     <listitem>
+      <para>
+       The new schema of the function. You must own the function to change its
+       current schema.
+      </para>
+     </listitem>
+    </varlistentry>
+ 
      <varlistentry>
       <term><literal>CALLED ON NULL INPUT</literal></term>
       <term><literal>RETURNS NULL ON NULL INPUT</literal></term>
***************
*** 193,198 ****
--- 205,218 ----
  ALTER FUNCTION sqrt(integer) OWNER TO joe;
  </programlisting>
    </para>
+ 
+   <para>
+    To change the schema of the function <literal>sqrt</literal> for type
+    <type>integer</type> to <literal>maths</literal>:
+ <programlisting>
+ ALTER FUNCTION sqrt(integer) SET SCHEMA maths;
+ </programlisting>
+   </para>
   </refsect1>
  
   <refsect1>
Index: doc/src/sgml/ref/alter_sequence.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_sequence.sgml,v
retrieving revision 1.9
diff -c -B -r1.9 alter_sequence.sgml
*** doc/src/sgml/ref/alter_sequence.sgml	27 Nov 2004 21:27:07 -0000	1.9
--- doc/src/sgml/ref/alter_sequence.sgml	1 Aug 2005 14:26:25 -0000
***************
*** 27,32 ****
--- 27,33 ----
  ALTER SEQUENCE <replaceable class="parameter">name</replaceable> [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
      [ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ]
      [ RESTART [ WITH ] <replaceable class="parameter">start</replaceable> ] [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
+ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <replaceable class="parameter">schema_name</replaceable>
    </synopsis>
   </refsynopsisdiv>
  
***************
*** 155,160 ****
--- 156,171 ----
         </para>
        </listitem>
       </varlistentry>
+ 
+      <varlistentry>
+       <term><replaceable class="parameter">schema_name</replaceable></term>
+       <listitem>
+        <para>
+         The new schema name of the sequence. You are required to be the owner
+         of the sequence in order to change its schema.
+        </para>
+       </listitem>
+      </varlistentry>
      </variablelist>
     </para>
    </refsect1>
***************
*** 193,199 ****
    <title>Compatibility</title>
  
    <para>
!    <command>ALTER SEQUENCE</command> conforms with <acronym>SQL:2003</acronym>.
    </para>
   </refsect1>
  </refentry>
--- 204,212 ----
    <title>Compatibility</title>
  
    <para>
!    <command>ALTER SEQUENCE</command> conforms with <acronym>SQL:2003</acronym>, 
!    except for the <literal>SET SCHEMA</literal> variant, which is a <productname>
!    PostgreSQL</productname> extension.
    </para>
   </refsect1>
  </refentry>
Index: doc/src/sgml/ref/alter_table.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v
retrieving revision 1.77
diff -c -B -r1.77 alter_table.sgml
*** doc/src/sgml/ref/alter_table.sgml	14 Jan 2005 01:16:52 -0000	1.77
--- doc/src/sgml/ref/alter_table.sgml	1 Aug 2005 14:26:27 -0000
***************
*** 44,49 ****
--- 44,50 ----
      SET WITHOUT OIDS
      OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
      SET TABLESPACE <replaceable class="PARAMETER">tablespace_name</replaceable>
+     SET SCHEMA <replaceable class="PARAMETER">schema_name</replaceable>
  </synopsis>
   </refsynopsisdiv>
  
***************
*** 240,245 ****
--- 241,256 ----
     </varlistentry>
  
     <varlistentry>
+     <term><literal>SET SCHEMA</literal></term>
+     <listitem>
+      <para>
+       This form changes the schema of the table including all indexes and 
+       sequences of any SERIAL columns.
+      </para>
+     </listitem>
+    </varlistentry>
+ 
+    <varlistentry>
      <term><literal>SET TABLESPACE</literal></term>
      <listitem>
       <para>
***************
*** 279,284 ****
--- 290,301 ----
     You must own the table to use <command>ALTER TABLE</>; except for
     <command>ALTER TABLE OWNER</>, which may only be executed by a superuser.
    </para>
+ 
+   <para>
+    Changing the schema of a table requires you to have <literal>CREATE</literal>
+    privileges on both, the old and new schema.
+    See also <xref linkend="SQL-GRANT"> for more information.
+   </para>
   </refsect1>
  
   <refsect1>
***************
*** 405,410 ****
--- 422,436 ----
        </listitem>
       </varlistentry>
  
+      <varlistentry>
+       <term><replaceable class="PARAMETER">schema_name</replaceable></term>
+       <listitem>
+        <para>
+         The schema name to which the table will be moved.
+        </para>
+       </listitem>
+      </varlistentry>
+ 
      </variablelist>
   </refsect1>
  
Index: doc/src/sgml/ref/alter_type.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_type.sgml,v
retrieving revision 1.1
diff -c -B -r1.1 alter_type.sgml
*** doc/src/sgml/ref/alter_type.sgml	25 Jun 2004 21:55:50 -0000	1.1
--- doc/src/sgml/ref/alter_type.sgml	1 Aug 2005 14:26:27 -0000
***************
*** 25,30 ****
--- 25,31 ----
   <refsynopsisdiv>
    <synopsis>
  ALTER TYPE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable class="PARAMETER">new_owner</replaceable> 
+ ALTER TYPE <replaceable class="PARAMETER">name</replaceable> SET SChEMA <replaceable class="PARAMETER">schema_name</replaceable>
    </synopsis>
   </refsynopsisdiv>
  
***************
*** 33,39 ****
  
    <para>
     <command>ALTER TYPE</command> changes the definition of an existing type.
!    The only currently available capability is changing the owner of a type.
    </para>
   </refsect1>
  
--- 34,40 ----
  
    <para>
     <command>ALTER TYPE</command> changes the definition of an existing type.
!    The only currently available capabilities are changing the owner and schema of a type.
    </para>
   </refsect1>
  
***************
*** 62,72 ****
--- 63,94 ----
        </listitem>
       </varlistentry>
  
+      <varlistentry>
+       <term><replaceable class="PARAMETER">schema_name</replaceable></term>
+       <listitem>
+        <para>
+         The new schema name of the type. You must be owner of the type to change
+         its schema.
+        </para>
+       </listitem>
+      </varlistentry>
+ 
      </variablelist>
     </para>
    </refsect1>
  
   <refsect1>
+   <title>Notes</title>
+ 
+   <para>
+    To change a type's schema you are required to have <literal>CREATE</literal>
+    privileges on the old an new schema. See also <xref linkend="SQL-GRANT"> 
+    for more information.
+   </para>
+   
+  </refsect1>
+ 
+  <refsect1>
    <title>Examples</title>
  
    <para> 
***************
*** 76,81 ****
--- 98,111 ----
  ALTER TYPE email OWNER TO joe;
     </programlisting>
    </para>
+ 
+   <para>
+    To change the schema of the user-defined type <literal>email</literal>
+    to <literal>customers</literal>
+    <programlisting>
+ ALTER TYPE email SET SCHEMA customers;
+    </programlisting>
+   </para>
   </refsect1>
  
   <refsect1>
