=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> On PostgreSQL 11 Beta, I exec sql like "update
> fvt_obj_operate_update_table_033 set (c_int) = (20) where c_int = 20;",
> which only on column to set, got ""ERROR: source for a multiple-column
> UPDATE item must be a sub-SELECT or ROW() expression"".
It's telling you what to do: use a ROW() expression, ie
update fvt_obj_operate_update_table_033 set (c_int) = row(20)
where c_int = 20;
> But I exec sql like "update fvt_obj_operate_update_table_033 set
> (c_int,c_dp) = (20,1.11) where c_int = 20;", got successfull message.
(20) and row(20) are not the same thing, whereas (20,1.11) and
row(20,1.11) are the same thing. Don't blame us, it was the SQL
committee's idea that "ROW" should be optional for the latter.
> The cause of this error is because syntax rule conflict between "'(' a_expr
> ')' opt_indirection" and "implicit_row: '(' expr_list ',' a_expr ')'".I
> think "'(' a_expr ')'" is also a subset of row.
> I want to modify it, but didn‘t got a good idea.
Don't even think about it. It's unfixable without creating even worse
problems, like causing an extra pair of parentheses to change the meaning
of an expression.
regards, tom lane