Skip to content

2.27.0.0-b378

@arpang arpang tagged this 28 Jul 14:57
Summary:
Currently, DROP CASCADE on the source column of a generated column does not drop the generated column from docdb (it only drops it from the YSQL catalog).  Consequently,
```
CREATE TABLE table1(id INT, c1 INT, stored_col INT GENERATED ALWAYS AS (c1 * 2) STORED);
ALTER TABLE table1 DROP COLUMN c1 CASCADE;
ALTER TABLE table1 ADD COLUMN stored_col INT;
```
throws `ERROR:  The column already exists: stored_col`.

This revision fixes this issue by dropping the generated column from the docdb as well.
Jira: DB-17187

Test Plan:
   ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscIndependent'

Reviewers: fizaa, myang

Reviewed By: fizaa

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D44769
Assets 2
Loading