BUG #15237: I got "ERROR: source for a multiple-column UPDATE itemmust be a sub-SELECT or ROW() expression"
От | PG Bug reporting form |
---|---|
Тема | BUG #15237: I got "ERROR: source for a multiple-column UPDATE itemmust be a sub-SELECT or ROW() expression" |
Дата | |
Msg-id | 152876885706.32361.1270737678956483321@wrigleys.postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"
|
Список | pgsql-bugs |
The following bug has been logged on the website: Bug reference: 15237 Logged by: zhou xiaowei Email address: 110876189@qq.com PostgreSQL version: 11beta1 Operating system: centos Description: 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"". 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. Detail: postgres=# \d fvt_obj_operate_update_table_033 Table "public.fvt_obj_operate_update_table_033" Column | Type | Collation | Nullable | Default --------------+-----------------------------+-----------+----------+--------- c_char | character(102400) | | | c_varchar | character varying(1024) | | | c_int | integer | | | c_dp | double precision | | | c_ts_without | timestamp without time zone | | | Indexes: "fvt_obj_operate_update_index_033" UNIQUE, btree (c_int) postgres=# update fvt_obj_operate_update_table_033 set (c_int) = (20) where c_int = 20; 2018-06-12 09:46:39.877 CST [94901] ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression at character 56 2018-06-12 09:46:39.877 CST [94901] STATEMENT: update fvt_obj_operate_update_table_033 set (c_int) = (20) where c_int = 20; ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression LINE 1: ...e fvt_obj_operate_update_table_033 set (c_int) = (20) where ... ^ postgres=# update fvt_obj_operate_update_table_033 set (c_int,c_dp) = (20,1.11) where c_int = 20; UPDATE 1 postgres=# 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. Please help,thanks!
В списке pgsql-bugs по дате отправления: