OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / doc / postgresql / html / sql-altertable.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >ALTER TABLE</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REV="MADE"
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
11 REL="HOME"
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
14 REL="UP"
15 TITLE="SQL Commands"
16 HREF="sql-commands.html"><LINK
17 REL="PREVIOUS"
18 TITLE="ALTER SEQUENCE"
19 HREF="sql-altersequence.html"><LINK
20 REL="NEXT"
21 TITLE="ALTER TRIGGER"
22 HREF="sql-altertrigger.html"><LINK
23 REL="STYLESHEET"
24 TYPE="text/css"
25 HREF="stylesheet.css"><META
26 NAME="creation"
27 CONTENT="2003-12-22T03:48:47"></HEAD
28 ><BODY
29 CLASS="REFENTRY"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="5"
41 ALIGN="center"
42 VALIGN="bottom"
43 >PostgreSQL 7.4.1 Documentation</TH
44 ></TR
45 ><TR
46 ><TD
47 WIDTH="10%"
48 ALIGN="left"
49 VALIGN="top"
50 ><A
51 HREF="sql-altersequence.html"
52 ACCESSKEY="P"
53 >Prev</A
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="left"
58 VALIGN="top"
59 ><A
60 HREF="sql-altersequence.html"
61 >Fast Backward</A
62 ></TD
63 ><TD
64 WIDTH="60%"
65 ALIGN="center"
66 VALIGN="bottom"
67 ></TD
68 ><TD
69 WIDTH="10%"
70 ALIGN="right"
71 VALIGN="top"
72 ><A
73 HREF="sql-altertrigger.html"
74 >Fast Forward</A
75 ></TD
76 ><TD
77 WIDTH="10%"
78 ALIGN="right"
79 VALIGN="top"
80 ><A
81 HREF="sql-altertrigger.html"
82 ACCESSKEY="N"
83 >Next</A
84 ></TD
85 ></TR
86 ></TABLE
87 ><HR
88 ALIGN="LEFT"
89 WIDTH="100%"></DIV
90 ><H1
91 ><A
92 NAME="SQL-ALTERTABLE"
93 ></A
94 >ALTER TABLE</H1
95 ><DIV
96 CLASS="REFNAMEDIV"
97 ><A
98 NAME="AEN35231"
99 ></A
100 ><H2
101 >Name</H2
102 >ALTER TABLE&nbsp;--&nbsp;change the definition of a table</DIV
103 ><A
104 NAME="AEN35234"
105 ></A
106 ><DIV
107 CLASS="REFSYNOPSISDIV"
108 ><A
109 NAME="AEN35236"
110 ></A
111 ><H2
112 >Synopsis</H2
113 ><PRE
114 CLASS="SYNOPSIS"
115 >ALTER TABLE [ ONLY ] <VAR
116 CLASS="REPLACEABLE"
117 >name</VAR
118 > [ * ]
119     ADD [ COLUMN ] <VAR
120 CLASS="REPLACEABLE"
121 >column</VAR
122 > <VAR
123 CLASS="REPLACEABLE"
124 >type</VAR
125 > [ <VAR
126 CLASS="REPLACEABLE"
127 >column_constraint</VAR
128 > [ ... ] ]
129 ALTER TABLE [ ONLY ] <VAR
130 CLASS="REPLACEABLE"
131 >name</VAR
132 > [ * ]
133     DROP [ COLUMN ] <VAR
134 CLASS="REPLACEABLE"
135 >column</VAR
136 > [ RESTRICT | CASCADE ]
137 ALTER TABLE [ ONLY ] <VAR
138 CLASS="REPLACEABLE"
139 >name</VAR
140 > [ * ]
141     ALTER [ COLUMN ] <VAR
142 CLASS="REPLACEABLE"
143 >column</VAR
144 > { SET DEFAULT <VAR
145 CLASS="REPLACEABLE"
146 >expression</VAR
147 > | DROP DEFAULT }
148 ALTER TABLE [ ONLY ] <VAR
149 CLASS="REPLACEABLE"
150 >name</VAR
151 > [ * ]
152     ALTER [ COLUMN ] <VAR
153 CLASS="REPLACEABLE"
154 >column</VAR
155 > { SET | DROP } NOT NULL
156 ALTER TABLE [ ONLY ] <VAR
157 CLASS="REPLACEABLE"
158 >name</VAR
159 > [ * ]
160     ALTER [ COLUMN ] <VAR
161 CLASS="REPLACEABLE"
162 >column</VAR
163 > SET STATISTICS <VAR
164 CLASS="REPLACEABLE"
165 >integer</VAR
166 >
167 ALTER TABLE [ ONLY ] <VAR
168 CLASS="REPLACEABLE"
169 >name</VAR
170 > [ * ]
171     ALTER [ COLUMN ] <VAR
172 CLASS="REPLACEABLE"
173 >column</VAR
174 > SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
175 ALTER TABLE [ ONLY ] <VAR
176 CLASS="REPLACEABLE"
177 >name</VAR
178 > [ * ]
179     SET WITHOUT OIDS
180 ALTER TABLE [ ONLY ] <VAR
181 CLASS="REPLACEABLE"
182 >name</VAR
183 > [ * ]
184     RENAME [ COLUMN ] <VAR
185 CLASS="REPLACEABLE"
186 >column</VAR
187 > TO <VAR
188 CLASS="REPLACEABLE"
189 >new_column</VAR
190 >
191 ALTER TABLE <VAR
192 CLASS="REPLACEABLE"
193 >name</VAR
194 >
195     RENAME TO <VAR
196 CLASS="REPLACEABLE"
197 >new_name</VAR
198 >
199 ALTER TABLE [ ONLY ] <VAR
200 CLASS="REPLACEABLE"
201 >name</VAR
202 > [ * ]
203     ADD <VAR
204 CLASS="REPLACEABLE"
205 >table_constraint</VAR
206 >
207 ALTER TABLE [ ONLY ] <VAR
208 CLASS="REPLACEABLE"
209 >name</VAR
210 > [ * ]
211     DROP CONSTRAINT <VAR
212 CLASS="REPLACEABLE"
213 >constraint_name</VAR
214 > [ RESTRICT | CASCADE ]
215 ALTER TABLE <VAR
216 CLASS="REPLACEABLE"
217 >name</VAR
218 >
219     OWNER TO <VAR
220 CLASS="REPLACEABLE"
221 >new_owner</VAR
222 >
223 ALTER TABLE <VAR
224 CLASS="REPLACEABLE"
225 >name</VAR
226 >
227     CLUSTER ON <VAR
228 CLASS="REPLACEABLE"
229 >index_name</VAR
230 ></PRE
231 ></DIV
232 ><DIV
233 CLASS="REFSECT1"
234 ><A
235 NAME="AEN35268"
236 ></A
237 ><H2
238 >Description</H2
239 ><P
240 >   <TT
241 CLASS="COMMAND"
242 >ALTER TABLE</TT
243 > changes the definition of an existing table.
244    There are several subforms:
245
246   <P
247 ></P
248 ></P><DIV
249 CLASS="VARIABLELIST"
250 ><DL
251 ><DT
252 ><TT
253 CLASS="LITERAL"
254 >ADD COLUMN</TT
255 ></DT
256 ><DD
257 ><P
258 >      This form adds a new column to the table using the same syntax as
259       <A
260 HREF="sql-createtable.html"
261 ><I
262 >CREATE TABLE</I
263 ></A
264 >.
265      </P
266 ></DD
267 ><DT
268 ><TT
269 CLASS="LITERAL"
270 >DROP COLUMN</TT
271 ></DT
272 ><DD
273 ><P
274 >      This form drops a column from a table.  Indexes and
275       table constraints involving the column will be automatically
276       dropped as well.  You will need to say <TT
277 CLASS="LITERAL"
278 >CASCADE</TT
279 > if
280       anything outside the table depends on the column, for example,
281       foreign key references or views.
282      </P
283 ></DD
284 ><DT
285 ><TT
286 CLASS="LITERAL"
287 >SET</TT
288 >/<TT
289 CLASS="LITERAL"
290 >DROP DEFAULT</TT
291 ></DT
292 ><DD
293 ><P
294 >      These forms set or remove the default value for a column.
295       The default values only apply to subsequent <TT
296 CLASS="COMMAND"
297 >INSERT</TT
298 >
299       commands; they do not cause rows already in the table to change.
300       Defaults may also be created for views, in which case they are
301       inserted into <TT
302 CLASS="COMMAND"
303 >INSERT</TT
304 > statements on the view before
305       the view's <TT
306 CLASS="LITERAL"
307 >ON INSERT</TT
308 > rule is applied.
309      </P
310 ></DD
311 ><DT
312 ><TT
313 CLASS="LITERAL"
314 >SET</TT
315 >/<TT
316 CLASS="LITERAL"
317 >DROP NOT NULL</TT
318 ></DT
319 ><DD
320 ><P
321 >      These forms change whether a column is marked to allow null
322       values or to reject null values.  You can only use <TT
323 CLASS="LITERAL"
324 >SET
325       NOT NULL</TT
326 > when the column contains no null values.
327      </P
328 ></DD
329 ><DT
330 ><TT
331 CLASS="LITERAL"
332 >SET STATISTICS</TT
333 ></DT
334 ><DD
335 ><P
336 >      This form
337       sets the per-column statistics-gathering target for subsequent
338       <A
339 HREF="sql-analyze.html"
340 ><I
341 >ANALYZE</I
342 ></A
343 > operations.
344       The target can be set in the range 0 to 1000; alternatively, set it
345       to -1 to revert to using the system default statistics target.
346      </P
347 ></DD
348 ><DT
349 ><TT
350 CLASS="LITERAL"
351 >SET STORAGE</TT
352 ></DT
353 ><DD
354 ><P
355 >      This form sets the storage mode for a column. This controls whether this
356       column is held inline or in a supplementary table, and whether the data
357       should be compressed or not. <TT
358 CLASS="LITERAL"
359 >PLAIN</TT
360 > must be used
361       for fixed-length values such as <TT
362 CLASS="TYPE"
363 >integer</TT
364 > and is
365       inline, uncompressed. <TT
366 CLASS="LITERAL"
367 >MAIN</TT
368 > is for inline,
369       compressible data. <TT
370 CLASS="LITERAL"
371 >EXTERNAL</TT
372 > is for external,
373       uncompressed data, and <TT
374 CLASS="LITERAL"
375 >EXTENDED</TT
376 > is for external,
377       compressed data.  <TT
378 CLASS="LITERAL"
379 >EXTENDED</TT
380 > is the default for all
381       data types that support it.  The use of <TT
382 CLASS="LITERAL"
383 >EXTERNAL</TT
384 > will, for example,
385       make substring operations on a <TT
386 CLASS="TYPE"
387 >text</TT
388 > column faster, at the penalty of
389       increased storage space.
390      </P
391 ></DD
392 ><DT
393 ><TT
394 CLASS="LITERAL"
395 >SET WITHOUT OIDS</TT
396 ></DT
397 ><DD
398 ><P
399 >      This form removes the <TT
400 CLASS="LITERAL"
401 >oid</TT
402 > column from the
403       table.  Removing OIDs from a table does not occur immediately.
404       The space that the OID uses will be reclaimed when the row is
405       updated.  Without updating the row, both the space and the value
406       of the OID are kept indefinitely.  This is semantically similar
407       to the <TT
408 CLASS="LITERAL"
409 >DROP COLUMN</TT
410 > process.
411      </P
412 ></DD
413 ><DT
414 ><TT
415 CLASS="LITERAL"
416 >RENAME</TT
417 ></DT
418 ><DD
419 ><P
420 >      The <TT
421 CLASS="LITERAL"
422 >RENAME</TT
423 > forms change the name of a table
424       (or an index, sequence, or view) or the name of an individual column in
425       a table. There is no effect on the stored data.
426      </P
427 ></DD
428 ><DT
429 ><TT
430 CLASS="LITERAL"
431 >ADD <VAR
432 CLASS="REPLACEABLE"
433 >table_constraint</VAR
434 ></TT
435 ></DT
436 ><DD
437 ><P
438 >      This form adds a new constraint to a table using the same syntax as
439       <A
440 HREF="sql-createtable.html"
441 ><I
442 >CREATE TABLE</I
443 ></A
444 >. 
445      </P
446 ></DD
447 ><DT
448 ><TT
449 CLASS="LITERAL"
450 >DROP CONSTRAINT</TT
451 ></DT
452 ><DD
453 ><P
454 >      This form drops constraints on a table.
455       Currently, constraints on tables are not required to have unique
456       names, so there may be more than one constraint matching the specified
457       name.  All such constraints will be dropped.
458      </P
459 ></DD
460 ><DT
461 ><TT
462 CLASS="LITERAL"
463 >OWNER</TT
464 ></DT
465 ><DD
466 ><P
467 >      This form changes the owner of the table, index, sequence, or view to the
468       specified user.
469      </P
470 ></DD
471 ><DT
472 ><TT
473 CLASS="LITERAL"
474 >CLUSTER</TT
475 ></DT
476 ><DD
477 ><P
478 >      This form marks a table for future <A
479 HREF="sql-cluster.html"
480 ><I
481 >CLUSTER</I
482 ></A
483 >
484       operations.
485      </P
486 ></DD
487 ></DL
488 ></DIV
489 ><P>
490   </P
491 ><P
492 >   You must own the table to use <TT
493 CLASS="COMMAND"
494 >ALTER TABLE</TT
495 >; except for
496    <TT
497 CLASS="COMMAND"
498 >ALTER TABLE OWNER</TT
499 >, which may only be executed by a superuser.
500   </P
501 ></DIV
502 ><DIV
503 CLASS="REFSECT1"
504 ><A
505 NAME="AEN35359"
506 ></A
507 ><H2
508 >Parameters</H2
509 ><P
510 ></P
511 ><DIV
512 CLASS="VARIABLELIST"
513 ><DL
514 ><DT
515 ><VAR
516 CLASS="REPLACEABLE"
517 >name</VAR
518 ></DT
519 ><DD
520 ><P
521 >       The name (possibly schema-qualified) of an existing table to
522         alter. If <TT
523 CLASS="LITERAL"
524 >ONLY</TT
525 > is specified, only that table is
526         altered. If <TT
527 CLASS="LITERAL"
528 >ONLY</TT
529 > is not specified, the table and all
530         its descendant tables (if any) are updated. <TT
531 CLASS="LITERAL"
532 >*</TT
533 > can be
534         appended to the table name to indicate that descendant tables are
535         to be altered, but in the current version, this is the default
536         behavior.  (In releases before 7.1, <TT
537 CLASS="LITERAL"
538 >ONLY</TT
539 > was the
540         default behavior.  The default can be altered by changing the
541         configuration parameter <VAR
542 CLASS="VARNAME"
543 >sql_inheritance</VAR
544 >.)
545        </P
546 ></DD
547 ><DT
548 ><VAR
549 CLASS="REPLACEABLE"
550 >column</VAR
551 ></DT
552 ><DD
553 ><P
554 >       Name of a new or existing column.
555        </P
556 ></DD
557 ><DT
558 ><VAR
559 CLASS="REPLACEABLE"
560 >type</VAR
561 ></DT
562 ><DD
563 ><P
564 >       Data type of the new column.
565        </P
566 ></DD
567 ><DT
568 ><VAR
569 CLASS="REPLACEABLE"
570 >new_column</VAR
571 ></DT
572 ><DD
573 ><P
574 >       New name for an existing column.
575        </P
576 ></DD
577 ><DT
578 ><VAR
579 CLASS="REPLACEABLE"
580 >new_name</VAR
581 ></DT
582 ><DD
583 ><P
584 >       New name for the table.
585        </P
586 ></DD
587 ><DT
588 ><VAR
589 CLASS="REPLACEABLE"
590 >table_constraint</VAR
591 ></DT
592 ><DD
593 ><P
594 >       New table constraint for the table.
595        </P
596 ></DD
597 ><DT
598 ><VAR
599 CLASS="REPLACEABLE"
600 >constraint_name</VAR
601 ></DT
602 ><DD
603 ><P
604 >       Name of an existing constraint to drop.
605        </P
606 ></DD
607 ><DT
608 ><VAR
609 CLASS="REPLACEABLE"
610 >new_owner</VAR
611 ></DT
612 ><DD
613 ><P
614 >       The user name of the new owner of the table.
615        </P
616 ></DD
617 ><DT
618 ><VAR
619 CLASS="REPLACEABLE"
620 >index_name</VAR
621 ></DT
622 ><DD
623 ><P
624 >       The index name on which the table should be marked for clustering.
625        </P
626 ></DD
627 ><DT
628 ><TT
629 CLASS="LITERAL"
630 >CASCADE</TT
631 ></DT
632 ><DD
633 ><P
634 >        Automatically drop objects that depend on the dropped column
635         or constraint (for example, views referencing the column).
636        </P
637 ></DD
638 ><DT
639 ><TT
640 CLASS="LITERAL"
641 >RESTRICT</TT
642 ></DT
643 ><DD
644 ><P
645 >        Refuse to drop the column or constraint if there are any dependent
646         objects. This is the default behavior.
647        </P
648 ></DD
649 ></DL
650 ></DIV
651 ></DIV
652 ><DIV
653 CLASS="REFSECT1"
654 ><A
655 NAME="AEN35422"
656 ></A
657 ><H2
658 >Notes</H2
659 ><P
660 >    The key word <TT
661 CLASS="LITERAL"
662 >COLUMN</TT
663 > is noise and can be omitted.
664    </P
665 ><P
666 >    In the current implementation of <TT
667 CLASS="LITERAL"
668 >ADD COLUMN</TT
669 >,
670     default and <TT
671 CLASS="LITERAL"
672 >NOT NULL</TT
673 > clauses for the new column are not supported.
674     The new column always comes into being with all values null.
675     You can use the <TT
676 CLASS="LITERAL"
677 >SET DEFAULT</TT
678 > form
679     of <TT
680 CLASS="COMMAND"
681 >ALTER TABLE</TT
682 > to set the default afterward.
683     (You may also want to update the already existing rows to the
684     new default value, using
685     <A
686 HREF="sql-update.html"
687 ><I
688 >UPDATE</I
689 ></A
690 >.)
691     If you want to mark the column non-null, use the <TT
692 CLASS="LITERAL"
693 >SET NOT NULL</TT
694 >
695     form after you've entered non-null values for the column in all rows.
696    </P
697 ><P
698 >    The <TT
699 CLASS="LITERAL"
700 >DROP COLUMN</TT
701 > form does not physically remove
702     the column, but simply makes it invisible to SQL operations.  Subsequent
703     insert and update operations in the table will store a null value for the column.
704     Thus, dropping a column is quick but it will not immediately reduce the
705     on-disk size of your table, as the space occupied 
706     by the dropped column is not reclaimed.  The space will be
707     reclaimed over time as existing rows are updated.
708     To reclaim the space at once, do a dummy <TT
709 CLASS="COMMAND"
710 >UPDATE</TT
711 > of all rows
712     and then vacuum, as in:
713 </P><PRE
714 CLASS="PROGRAMLISTING"
715 >UPDATE table SET col = col;
716 VACUUM FULL table;</PRE
717 ><P>
718    </P
719 ><P
720 >    If a table has any descendant tables, it is not permitted to add
721     or rename a column in the parent table without doing the same to
722     the descendants.  That is, <TT
723 CLASS="COMMAND"
724 >ALTER TABLE ONLY</TT
725 >
726     will be rejected.  This ensures that the descendants always have
727     columns matching the parent.
728    </P
729 ><P
730 >    A recursive <TT
731 CLASS="LITERAL"
732 >DROP COLUMN</TT
733 > operation will remove a
734     descendant table's column only if the descendant does not inherit
735     that column from any other parents and never had an independent
736     definition of the column.  A nonrecursive <TT
737 CLASS="LITERAL"
738 >DROP
739     COLUMN</TT
740 > (i.e., <TT
741 CLASS="COMMAND"
742 >ALTER TABLE ONLY ... DROP
743     COLUMN</TT
744 >) never removes any descendant columns, but
745     instead marks them as independently defined rather than inherited.
746    </P
747 ><P
748 >    Changing any part of a system catalog table is not permitted.
749    </P
750 ><P
751 >    Refer to <TT
752 CLASS="COMMAND"
753 >CREATE TABLE</TT
754 > for a further description
755     of valid parameters. <A
756 HREF="ddl.html"
757 >Chapter 5</A
758 > has further information on
759     inheritance.
760    </P
761 ></DIV
762 ><DIV
763 CLASS="REFSECT1"
764 ><A
765 NAME="AEN35447"
766 ></A
767 ><H2
768 >Examples</H2
769 ><P
770 >   To add a column of type <TT
771 CLASS="TYPE"
772 >varchar</TT
773 > to a table:
774 </P><PRE
775 CLASS="PROGRAMLISTING"
776 >ALTER TABLE distributors ADD COLUMN address varchar(30);</PRE
777 ><P>
778   </P
779 ><P
780 >   To drop a column from a table:
781 </P><PRE
782 CLASS="PROGRAMLISTING"
783 >ALTER TABLE distributors DROP COLUMN address RESTRICT;</PRE
784 ><P>
785   </P
786 ><P
787 >   To rename an existing column:
788 </P><PRE
789 CLASS="PROGRAMLISTING"
790 >ALTER TABLE distributors RENAME COLUMN address TO city;</PRE
791 ><P>
792   </P
793 ><P
794 >   To rename an existing table:
795 </P><PRE
796 CLASS="PROGRAMLISTING"
797 >ALTER TABLE distributors RENAME TO suppliers;</PRE
798 ><P>
799   </P
800 ><P
801 >   To add a not-null constraint to a column:
802 </P><PRE
803 CLASS="PROGRAMLISTING"
804 >ALTER TABLE distributors ALTER COLUMN street SET NOT NULL;</PRE
805 ><P>
806    To remove a not-null constraint from a column:
807 </P><PRE
808 CLASS="PROGRAMLISTING"
809 >ALTER TABLE distributors ALTER COLUMN street DROP NOT NULL;</PRE
810 ><P>
811   </P
812 ><P
813
814    To add a check constraint to a table:
815 </P><PRE
816 CLASS="PROGRAMLISTING"
817 >ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5);</PRE
818 ><P>
819   </P
820 ><P
821
822    To remove a check constraint from a table and all its children:
823 </P><PRE
824 CLASS="PROGRAMLISTING"
825 >ALTER TABLE distributors DROP CONSTRAINT zipchk;</PRE
826 ><P>
827   </P
828 ><P
829
830    To add a foreign key constraint to a table:
831 </P><PRE
832 CLASS="PROGRAMLISTING"
833 >ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses (address) MATCH FULL;</PRE
834 ><P>
835   </P
836 ><P
837
838    To add a (multicolumn) unique constraint to a table:
839 </P><PRE
840 CLASS="PROGRAMLISTING"
841 >ALTER TABLE distributors ADD CONSTRAINT dist_id_zipcode_key UNIQUE (dist_id, zipcode);</PRE
842 ><P>
843   </P
844 ><P
845
846    To add an automatically named primary key constraint to a table, noting
847    that a table can only ever have one primary key:
848 </P><PRE
849 CLASS="PROGRAMLISTING"
850 >ALTER TABLE distributors ADD PRIMARY KEY (dist_id);</PRE
851 ><P>
852   </P
853 ></DIV
854 ><DIV
855 CLASS="REFSECT1"
856 ><A
857 NAME="AEN35471"
858 ></A
859 ><H2
860 >Compatibility</H2
861 ><P
862 >   The <TT
863 CLASS="LITERAL"
864 >ADD COLUMN</TT
865 > form conforms with the SQL
866    standard, with the exception that it does not support defaults and
867    not-null constraints, as explained above.  The <TT
868 CLASS="LITERAL"
869 >ALTER
870    COLUMN</TT
871 > form is in full conformance.
872   </P
873 ><P
874 >   The clauses to rename tables, columns, indexes, views, and sequences are
875    <SPAN
876 CLASS="PRODUCTNAME"
877 >PostgreSQL</SPAN
878 > extensions of the SQL standard.
879   </P
880 ><P
881 >   <TT
882 CLASS="COMMAND"
883 >ALTER TABLE DROP COLUMN</TT
884 > can be used to drop the only
885    column of a table, leaving a zero-column table.  This is an
886    extension of SQL, which disallows zero-column tables.
887   </P
888 ></DIV
889 ><DIV
890 CLASS="NAVFOOTER"
891 ><HR
892 ALIGN="LEFT"
893 WIDTH="100%"><TABLE
894 SUMMARY="Footer navigation table"
895 WIDTH="100%"
896 BORDER="0"
897 CELLPADDING="0"
898 CELLSPACING="0"
899 ><TR
900 ><TD
901 WIDTH="33%"
902 ALIGN="left"
903 VALIGN="top"
904 ><A
905 HREF="sql-altersequence.html"
906 ACCESSKEY="P"
907 >Prev</A
908 ></TD
909 ><TD
910 WIDTH="34%"
911 ALIGN="center"
912 VALIGN="top"
913 ><A
914 HREF="index.html"
915 ACCESSKEY="H"
916 >Home</A
917 ></TD
918 ><TD
919 WIDTH="33%"
920 ALIGN="right"
921 VALIGN="top"
922 ><A
923 HREF="sql-altertrigger.html"
924 ACCESSKEY="N"
925 >Next</A
926 ></TD
927 ></TR
928 ><TR
929 ><TD
930 WIDTH="33%"
931 ALIGN="left"
932 VALIGN="top"
933 >ALTER SEQUENCE</TD
934 ><TD
935 WIDTH="34%"
936 ALIGN="center"
937 VALIGN="top"
938 ><A
939 HREF="sql-commands.html"
940 ACCESSKEY="U"
941 >Up</A
942 ></TD
943 ><TD
944 WIDTH="33%"
945 ALIGN="right"
946 VALIGN="top"
947 >ALTER TRIGGER</TD
948 ></TR
949 ></TABLE
950 ></DIV
951 ></BODY
952 ></HTML
953 >