pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: 110876189@qq.com
Subject: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"
Date: Tue, 12 Jun 2018 02:00:57 +0000
Message-ID: <152876885706.32361.1270737678956483321@wrigleys.postgresql.org> (raw)

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!



view thread (12+ messages)  latest in thread

Message-ID: <152876885706.32361.1270737678956483321@wrigleys.postgresql.org>
Permalink:  ../152876885706.32361.1270737678956483321@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/152876885706.32361.1270737678956483321@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, 110876189@qq.com
  Subject: Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"
  In-Reply-To: <152876885706.32361.1270737678956483321@wrigleys.postgresql.org>
  References: <152876885706.32361.1270737678956483321@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox