Hi,
On Vertica 6, I tried to run the following sequence of DDL to modify a column type:
ALTER TABLE t1 ADD COLUMN c1_new NUMERIC(18, 2) NOT NULL DEFAULT c1;
ALTER TABLE t1 ALTER COLUMN c1_new DROP DEFAULT;
ALTER TABLE t1 DROP COLUMN c1;
ALTER TABLE t1 RENAME COLUMN c1_new TO c1;
When executed in a script the first 2 statements run without problem but the 3rd statement fails with the error message:
[ALTER - 0 row(s), 0.197 secs] [Error Code: 100081, SQL State: HY000] [Vertica][VJDBC](100081) ROLLBACK: Cannot drop column "c1" since it was referenced in the default expression of added column "c1_new"
If I wait for a while (no more than a minute) and run the 3rd statement again, it would succeed.
The table has about 7500 rows.
It feels like DROP DEFAULT does not get the job done immediately, or something. Anyway, how do I make sure the DDL can be executed successfully as a script (by DBAs)? Is there a way to explicitly wait for the DROP DEFAULT to take effect before running the next statement?
Thanks,
Brian