Skip to content

sql: partial predicate causes error for UPDATE .. FROM #61284

@RaduBerinde

Description

@RaduBerinde

A partial index predicate is generating an ambigous column error with UPDATE .. FROM, when the same column name is produced by the FROM relation. Example:

> create table t (a int primary key, b int, c int, index (b,c) where c > 0);
> update t set b=v.b, c=v.c from (values (1,1), (2,2)) as v(b,c) where t.b=v.b;
ERROR: column reference "c" is ambiguous (candidates: t.c, v.c)
SQLSTATE: 42702

The same statement works if where c > 0 is removed from the index.

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions