cockroachdb / cockroachdb/cockroach

sql: support forward indexing on tsvector

Open
#110,821 2 comments 0 reactions 0 assignees View on GitHub
A-tools-efcore C-bug O-community T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

Given a table created using the following SQL

```
CREATE TABLE "Blogs" (
"Description" text,
"Title" text NOT NULL
);
```

Run the following SQL to create a new index

```
CREATE INDEX ""IX_Blogs_Title_Description"" ON ""Blogs"" (to_tsvector('simple', ""Title"" || ' ' || coalesce(""Description"", '')));
```

The following error is returned

```
42P16: index element to_tsvector('simple', ("Title" || ' ') || COALESCE("Description", '')) of type tsvector is not indexable in a non-inverted index
```

**Additional context**
This affects efcore.pg tests

@fqazi

Jira issue: CRDB-31636

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.