Skip to content

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

Open
@jordanlewis

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-sql-pgcompatSemantic compatibility with PostgreSQLA-sql-typingSQLtype inference, typing rules, type compatibility.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    • Status

      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions