cockroachdb / cockroachdb/cockroach
QA: Confusing error message creating inverted index with TSQuery column
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
From [TSVector and TSQuery QA](https://gist.github.com/msirek/2c4aef2a3c2038f6b9f3a6fa443ad6da),
An attempt to create a table having an inverted index involving a TSQuery or TSVector column reports the column is only allowed as the last column of the index, and also that it is not allowed as the last column of the index:
```sql
CREATE TABLE a (v tsvector, q tsquery, i int, j json, inverted index (q,j));
ERROR: column q of type tsquery is only allowed as the last column in an inverted index
SQLSTATE: 0A000
HINT: see the documentation for more information about inverted indexes: https://www.cockroachlabs.com/docs/v23.1/inverted-indexes.html
CREATE TABLE a (v tsvector, q tsquery, i int, j json, inverted index (j, q));
ERROR: column q of type tsquery is not allowed as the last column in an inverted index
SQLSTATE: 0A000
HINT: see the documentation for more information about inverted indexes: https://www.cockroachlabs.com/docs/v23.1/inverted-indexes.html
```
Jira issue: CRDB-25479
Contributor guide
Assessment
This issue has not been assessed yet.