Has anyone else tried to test the DROP COLUMN feature in Vertica 6.0?
It seems to work when the table has no data, but as soon as it has data, it no longer works:
Code: Select all
dbadmin=> SELECT version();
version
------------------------------------
Vertica Analytic Database v6.0.0-0
(1 row)
dbadmin=> CREATE TABLE test (col1 INT, col2 VARCHAR(100));
CREATE TABLE
dbadmin=> ALTER TABLE test DROP COLUMN col2;
ALTER TABLE
dbadmin=> \d test;
List of Fields by Tables
Schema | Table | Column | Type | Size | Default | Not Null | Primary Key | Foreign Key
--------+-------+--------+------+------+---------+----------+-------------+-------------
public | test | col1 | int | 8 | | f | f |
(1 row)
dbadmin=> ALTER TABLE test ADD COLUMN col2 VARCHAR(100);
ALTER TABLE
dbadmin=> INSERT INTO test VALUES (1, 'test');
OUTPUT
--------
1
(1 row)
dbadmin=> ALTER TABLE test DROP COLUMN col2;
ROLLBACK 3128: DROP failed due to dependencies
DETAIL:
Projection public.test_b0 has column col2 as part of its segmentation expression
Projection public.test_b1 has column col2 as part of its segmentation expression
HINT: Use DROP .. CASCADE to drop or modify the dependent objects
Thanks!