Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSTvT-0006pv-M0 for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jul 2016 18:51:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bSTvT-00060s-8K for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jul 2016 18:51:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSTvS-0005z3-9A for pgsql-bugs@postgresql.org; Wed, 27 Jul 2016 18:51:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSTvP-0004xF-DE for pgsql-bugs@postgresql.org; Wed, 27 Jul 2016 18:51:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u6RIpK8p009748; Wed, 27 Jul 2016 14:51:21 -0400 From: Tom Lane To: ganuri@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14265: inserting multiple rows via array notation gives error In-reply-to: <20160727005725.7438.26021@wrigleys.postgresql.org> References: <20160727005725.7438.26021@wrigleys.postgresql.org> Comments: In-reply-to ganuri@gmail.com message dated "Wed, 27 Jul 2016 00:57:25 -0000" Date: Wed, 27 Jul 2016 14:51:20 -0400 Message-ID: <9747.1469645480@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ganuri@gmail.com writes: > given a table: > create table test ( testarray int[]); > this gives an error > insert into test (testarray[1], testarray[2]) values (1,2),(3,4) > ERROR: multiple assignments to same column "testarray" Yeah, that ought to work, but fixing it is nontrivial --- see https://www.postgresql.org/message-id/9578.1469645245%40sss.pgh.pa.us In the meantime, it works to do it with INSERT/SELECT, eg insert into test (testarray[1], testarray[2]) select 1,2 union all select 3,4; or even insert into test (testarray[1], testarray[2]) select * from (values (1,2),(3,4)) v; regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs