cockroachdb / cockroachdb/cockroach

opt: "ambiguous column" error when inserting into table with boolean column with check constraint and partial index predicate

Open
#141,730 1 comment 0 reactions 0 assignees View on GitHub
branch-release-21.2 branch-release-22.1 C-bug T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

```sql
CREATE TABLE t (
c BOOL,
CHECK (c),
INDEX (c) WHERE c
);

INSERT INTO t VALUES (true);
-- ERROR: column reference "c" is ambiguous (candidates: .c)
```

Another case of this (c must be the PK for this to reproduce):

```sql
CREATE TABLE t (
c BOOL PRIMARY KEY,
CHECK (c),
INDEX (c) WHERE c
);

UPSERT INTO t VALUES (true);
```

Jira issue: CRDB-47980

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.