Skip to content

Commit

Permalink
Merge #33144
Browse files Browse the repository at this point in the history
33144: sql: Uopdate unimplemented reference r=BramGruneir a=BramGruneir

And also clean up the wording to be more explicit.

The error for not being able to add a reference via alter was pointing to the
incorrect github ID #8855. It's been updated to point to #32917 instead.

Release note: None

Co-authored-by: Bram Gruneir <bram@cockroachlabs.com>
  • Loading branch information
craig[bot] and BramGruneir committed Dec 13, 2018
2 parents 6c526a7 + 645ba1a commit ca5d0cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/sql/alter_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ func (n *alterTableNode) startExec(params runParams) error {
d := t.ColumnDef
if len(d.CheckExprs) > 0 {
return pgerror.UnimplementedWithIssueError(29639,
"adding a CHECK constraint via ALTER not supported")
"adding a CHECK constraint while also adding a column via ALTER not supported")
}
if d.HasFKConstraint() {
return pgerror.UnimplementedWithIssueError(8855,
"adding a REFERENCES constraint via ALTER not supported")
return pgerror.UnimplementedWithIssueError(32917,
"adding a REFERENCES constraint while also adding a column via ALTER not supported")
}

newDef, seqDbDesc, seqName, seqOpts, err := params.p.processSerialInColumnDef(params.ctx, d, tn)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/alter_table
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ ALTER TABLE o DROP COLUMN h
statement ok
ALTER TABLE o DROP COLUMN h CASCADE

statement error adding a CHECK constraint via ALTER not supported
statement error adding a CHECK constraint while also adding a column via ALTER not supported
ALTER TABLE t ADD f INT CHECK (f>1)

statement error adding a REFERENCES constraint via ALTER not supported
statement error adding a REFERENCES constraint while also adding a column via ALTER not supported
ALTER TABLE t ADD f INT UNIQUE REFERENCES other

# Test that more than one column with constraints can be added in the same
Expand Down

0 comments on commit ca5d0cd

Please sign in to comment.