

The optional COLLATE clause specifies a collation for the new column if omitted, the collation is the default for the new column type. Indexes and simple table constraints involving the column will be automatically converted to use the new column type by reparsing the originally supplied expression. Note that you cannot alter column data types that are being used as distribution or partitioning keys. SET DATA TYPE - This form changes the data type of a column of a table. IF EXISTS - Do not throw an error if the table does not exist. If IF EXISTS is specified and the column does not exist, no error is thrown a notice is issued instead.

You need to say CASCADE if anything outside the table depends on the column (such as views). Indexes and table constraints involving the column are automatically dropped as well. Note that if you drop table columns that are being used as the Greenplum Database distribution key, the distribution policy for the table will be changed to DISTRIBUTED RANDOMLY. For information about table rewrites performed by ALTER TABLE, see Notes.ĭROP COLUMN - Drops a column from a table. For append-optimized and hash tables, ADD COLUMN requires a table rewrite.

Synopsis ALTER TABLE ĪLTER TABLE ALL IN TABLESPACE ]ĭROP ĪLTER TYPE ĪLTER column SET ( = )ĪLTER column RESET ( )ĭROP CONSTRAINT
