cockroachdb / cockroachdb/cockroach

sql: typechecking values clauses with tuples containing nulls is inconsistent with Postgres

Open
#93,349 0 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat A-sql-typing C-bug T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The following expression fails to typecheck in CockroachDB, but succeeds in Postgres:

`VALUES((1, 2)), ((1, NULL))`

CockroachDB:
```
demo@127.0.0.1:26257/defaultdb> values((1, 2)), ((1, null));

ERROR: VALUES types tuple{int, unknown} and tuple{int, int} cannot be matched
SQLSTATE: 42804
```

Postgres:
```
jordan=> values((1, 2)), ((1, null));
column1
---------
(1,2)
(1,)
(2 rows)
```

Jira issue: CRDB-22279

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.