|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.27 2001/09/07 21:57:53 momjian Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.28 2001/09/12 02:13:25 ishii Exp $ |
3 | 3 | Postgres documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -280,28 +280,28 @@ ALTER TABLE distributors RENAME TO suppliers;
|
280 | 280 | <para>
|
281 | 281 | To add a check constraint to a table:
|
282 | 282 | <programlisting>
|
283 |
| -ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5) |
| 283 | +ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5); |
284 | 284 | </programlisting>
|
285 | 285 | </para>
|
286 | 286 |
|
287 | 287 | <para>
|
288 | 288 | To remove a check constraint from a table and all its children:
|
289 | 289 | <programlisting>
|
290 |
| -ALTER TABLE distributors DROP CONSTRAINT zipchk |
| 290 | +ALTER TABLE distributors DROP CONSTRAINT zipchk; |
291 | 291 | </programlisting>
|
292 | 292 | </para>
|
293 | 293 |
|
294 | 294 | <para>
|
295 | 295 | To add a foreign key constraint to a table:
|
296 | 296 | <programlisting>
|
297 |
| -ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses(address) MATCH FULL |
| 297 | +ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses(address) MATCH FULL; |
298 | 298 | </programlisting>
|
299 | 299 | </para>
|
300 | 300 |
|
301 | 301 | <para>
|
302 | 302 | To add a (multi-column) unique constraint to a table:
|
303 | 303 | <programlisting>
|
304 |
| -ALTER TABLE distributors ADD CONSTRAINT dist_id_zipcode_key UNIQUE (dist_id, zipcode) |
| 304 | +ALTER TABLE distributors ADD CONSTRAINT dist_id_zipcode_key UNIQUE (dist_id, zipcode); |
305 | 305 | </programlisting>
|
306 | 306 | </para>
|
307 | 307 | </refsect1>
|
|