-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: partial predicate causes error for UPDATE .. FROM #61284
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.