cockroachdb / cockroachdb/cockroach

QA: Confusing error message creating inverted index with TSQuery column

Open
#98,735 0 comments 0 reactions 0 assignees View on GitHub
C-bug O-qa T-sql-queries
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.