Patch to ALTER TABLE docs

Started by Christopher Kings-Lynneover 24 years ago2 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au
1 attachment(s)

If it's true that the ALTER TABLE x ADD CONSTRAINT x CHECK (x) syntax is
supported in 7.1.1, here is a patch to that alter_table.sgml that documents
it.

Chris

Attachments:

alter_table_sgml.diffapplication/octet-stream; name=alter_table_sgml.diffDownload
Index: alter_table.sgml
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v
retrieving revision 1.23
diff -c -r1.23 alter_table.sgml
*** alter_table.sgml	2001/05/07 00:43:15	1.23
--- alter_table.sgml	2001/05/09 06:59:46
***************
*** 207,219 ****
     </para>
  
     <para>
!     In the current implementation, only FOREIGN KEY constraints can
      be added to a table.  To create or remove a unique constraint, create 
      a unique index (see <xref linkend="SQL-CREATEINDEX" 
!     endterm="SQL-CREATEINDEX-title">).  To add check constraints
!     you need to recreate and reload the table, using other 
!     parameters to the <xref linkend="SQL-CREATETABLE" 
!     endterm="SQL-CREATETABLE-title"> command.
     </para>
  
     <para>
--- 207,216 ----
     </para>
  
     <para>
!     In the current implementation, only FOREIGN KEY and CHECK constraints can
      be added to a table.  To create or remove a unique constraint, create 
      a unique index (see <xref linkend="SQL-CREATEINDEX" 
!     endterm="SQL-CREATEINDEX-title">).
     </para>
  
     <para>
***************
*** 253,258 ****
--- 250,262 ----
     To rename an existing table:
     <programlisting>
  ALTER TABLE distributors RENAME TO suppliers;
+    </programlisting>
+   </para>
+ 
+   <para> 
+    To add a check constraint to a table:
+    <programlisting>
+ ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5)
     </programlisting>
    </para>
  

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: Patch to ALTER TABLE docs

[ Charset ISO-8859-1 unsupported, converting... ]

If it's true that the ALTER TABLE x ADD CONSTRAINT x CHECK (x) syntax is
supported in 7.1.1, here is a patch to that alter_table.sgml that documents
it.

Chris

Thanks. Applied to 7.2.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026