-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#6985] YSQL: Add simple UNIQUE column
Summary: For now, DocDB doesn't roll back added columns in case of transaction failure, which makes adding a constrained column problematic. However, supporting adding a trivial UNIQUE column is still beneficial for supporting auto-generated migrations (e.g. this syntax is used by Dart/Aqueduct). For that, we change the way we do `YBCPrepareAlterTable`/`YBCExecAlterTable` so that DocDB's part of `ALTER TABLE` kicks in before we try to create an index - because an indexed column might not be there yet. Note that we still do not guarantee consistency in an odd case of the Postgres process crashing between adding a column and adding an index. --- Resolves #6985 Test Plan: ybd --java-test org.yb.pgsql.TestPgAlterTable Reviewers: dmitry, mihnea, jason, neil Reviewed By: jason Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D10546
- Loading branch information
1 parent
5b5a515
commit ce46d1a
Showing
5 changed files
with
298 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.