Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: uncategorized error for ALTER INDEX ... RENAME TO ... index does not exist #56465

Closed
jayshrivastava opened this issue Nov 9, 2020 · 0 comments · Fixed by #56455
Closed
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@jayshrivastava
Copy link
Contributor

The following error needs use pgcode.UndefinedObject

root@:26257/defaultdb> alter index foo@does_not_exist rename to "index";
ERROR: index "does_not_exist" does not exist
@jayshrivastava jayshrivastava added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Nov 9, 2020
@jayshrivastava jayshrivastava self-assigned this Nov 9, 2020
jayshrivastava added a commit to jayshrivastava/cockroach that referenced this issue Nov 10, 2020
Previously, executing a statement to rename an undefined
index would result in an uncategorized error. This change fixes
this behaviour by returning a pgcode.UndefinedObject (42704)
error in the same situation.

Closes: cockroachdb#56465

Release note (sql change): Attempting to rename undefined index
will return a pgcode.UndefinedObject (42704) error intead of
an uncategorized error.
craig bot pushed a commit that referenced this issue Nov 10, 2020
56455: sql: add pgcode to `ALTER COLUMN SET DEFAULT` type error r=ajwerner a=jayshrivastava

sql: add pgcode to `ALTER COLUMN SET DEFAULT` type error 

Previously, adding a default value of the wrong type to a
column would return an unclassifed error to the user. This change
resolves the issue by returning a pgcode.DatatypeMismatch (42804)
in the specified situation.

Closes: #56449

Release note (sql change): Added a pgcode (42804, DatatypeMismatch)
when adding a default value of the wrong type to a column.

---
sql: add pgcode to `ALTER INDEX ... RENAME TO` undefined index error

Previously, executing a statement to rename an undefined
index would result in an uncategorized error. This change fixes
this behaviour by returning a pgcode.UndefinedObject (42704)
error in the same situation.

Closes: #56465

Release note (sql change): Attempting to rename undefined index
will return a pgcode.UndefinedObject (42704) error intead of
an uncategorized error.

Co-authored-by: Jayant Shrivastava <jayants@cockroachlabs.com>
@craig craig bot closed this as completed in 846e450 Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant