Skip to content

2.25.2.0-b128

@fizaaluthra fizaaluthra tagged this 10 Mar 15:41
Summary:
`ATRewriteTable(...)` (phase 3 of ALTER TABLE execution) is responsible for rewriting tables and also performing any required constraint validations.

Commit 4d49141d6bde9a53e2dcc763eec0394d3cc9efad added initial support for `ALTER TABLE` operations, and introduced a work-around for failed `ALTER TABLE ... ADD CONSTRAINT ... CHECK` operations in the constraint validation logic in `ATRewriteTable(...)`: explicitly execute `ATExecDropConstraint` to clear the catalog entries.

Later, support was added for `ALTER TABLE ... VALIDATE CONSTRAINT`, along with a YB_TODO to change the condition for executing the `ATExecDropConstraint` work-around, as we don't want to drop the constraint in this case.

Resolve the YB_TODO by simply removing the work-around entirely. It is not needed, as constraint addition is a PG metadata only change, and is therefore already atomic (with or without DDL atomicity enabled).
Jira: DB-15664

Test Plan: Jenkins

Reviewers: myang

Reviewed By: myang

Subscribers: yql

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