Skip to content

sql: Error messages should be improved in case of no matching data source #22966

@rytaft

Description

@rytaft

Consider the following invalid query:

root@:26257/> select count(tpch.nation.n_nationkey) from tpch.customer c, tpch.public.nation n where tpch.public.customer.c_nationkey = nation.n_nationkey group by tpch.public.nation.n_nationkey limit 10;

The error that CockroachDB returns for this query is:

pq: no data source matches prefix: tpch.public.customer

PostgreSQL has a friendlier error message with a hint:

Postgres: ERROR: invalid reference to FROM-clause entry for table "nation" Hint: Perhaps you meant to reference the table alias "n". Position: 14

Metadata

Metadata

Assignees

Labels

A-sql-name-resolutionSQL name resolution rules and CTEs.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions