Skip to content

Create inverted index ignores the case of the column name #42944

@Bessonov

Description

@Bessonov

Describe the problem

No inverted index creation is possible, if column name is case-sensitive.

To Reproduce

Table:

CREATE TABLE phone (
  id UUID NOT NULL DEFAULT gen_random_uuid(),
  "idPerms" JSONB NOT NULL
);

Create index ignores the case (see column name in the error):

create inverted index on phone ("idPerms");
pq: verify-inverted-idx-count: column "idperms" does not exist

But for non existing field another error appears:

create inverted index on phone ("Test");
pq: index "phone_Test_idx" contains unknown column "Test"

For secondary index case matters and I get the right error message:

create index on phone ("idPerms");
pq: unimplemented: column idPerms is of type jsonb and thus is not indexable
HINT: You have attempted to use a feature that is not yet implemented.
See: https://github.com/cockroachdb/cockroach/issues/35730

It works, if column name is case-sensitive, but lower cased:

CREATE TABLE phone2 (
  id UUID NOT NULL DEFAULT gen_random_uuid(),
  "idperms" JSONB NOT NULL
);
CREATE TABLE

Time: 14.222225ms

create inverted index on phone2 ("idperms");
CREATE INDEX

Expected behavior
Yeah, that I can create an index for JSONB column with case-sensitive name.

Additional data / screenshots

Environment:

  • CockroachDB version: cockroachdb/cockroach:v19.2.0 from docker hub
  • Server OS: ubuntu 18.04
  • Client app: cockroach sql

Additional context
No index creation possible for a standard field of every table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-communityOriginated from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions