Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jahCw-0001rW-2W for pgsql-bugs@arkaria.postgresql.org; Mon, 18 May 2020 14:57:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jahCu-0008GX-Vl for pgsql-bugs@arkaria.postgresql.org; Mon, 18 May 2020 14:57:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jahCu-0008GP-PZ for pgsql-bugs@lists.postgresql.org; Mon, 18 May 2020 14:57:32 +0000 Received: from forward2-smtp.messagingengine.com ([66.111.4.226]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jahCr-00045e-JU for pgsql-bugs@lists.postgresql.org; Mon, 18 May 2020 14:57:31 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id A970A1941CCD; Mon, 18 May 2020 10:57:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 18 May 2020 10:57:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=wopPV4WlDxUQRghbKQA9x2/3h2UbbtXytoIjw1z1c Bg=; b=Mul+n1lcrhqyJ2Ih0vtbM9Xt2qr6zvFwDtRjbarH6npc1gVppiqxlxKu1 U7cO0mDI3S3VTTJxjMy0kVSPAOoyT9P9veF8pzAVMnwfQr2OQdXH5p+jfEl7bbkj bXv14MpvnNjCyr5bCOMcn5rTX8XS3fVyuxrhSVm5j28I08999hv7Zq4TCvcqMQ7p kpMyFzCrP3sK9Cek518QiUo2lSiyL4/2KAvh5iSztYbWg0MotjZz399FzPEqavj+ WII4+RqwMobApJQeExO3fgZQ/2WAvj7Sx0XsirgnvoxffBqH6mSJQcjG6BGgIwMT nUgq0WBsvXIXFlyPZT8E1u7O0c4dA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddthedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhfhokffffgggjggtgfesth ejredttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhmqeenucggtffrrg htthgvrhhnpedtveeghedtjedvvedvleejueevjeejtdellefgkeelfeeikeejlefgkedt udeuvdenucffohhmrghinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrd dvgeefrdekvddrvdegieenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgr ihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnughquhgrughrrghnth drtghomh X-ME-Proxy: Received: from april.pezone.net (p5df352f6.dip0.t-ipconnect.de [93.243.82.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 55F1730663E2; Mon, 18 May 2020 10:57:27 -0400 (EDT) Subject: Re: BUG #16441: Cannot multi-insert into generated column with DEFAULT value To: colin@darie.eu, pgsql-bugs@lists.postgresql.org References: <16441-f26a1a93b7a4bf7b@postgresql.org> From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <3a66b26f-0154-3216-1ed5-a63bf63ec61a@2ndquadrant.com> Date: Mon, 18 May 2020 16:57:26 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <16441-f26a1a93b7a4bf7b@postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-05-15 23:07, PG Bug reporting form wrote: > Multiple inserts of DEFAULT value for generated columns are failing. Single > inserts are OK. > > > CREATE TABLE squares (num INTEGER NOT NULL, square INTEGER GENERATED ALWAYS > AS (num * num) STORED); > > > INSERT INTO squares(num, square) VALUES (1, DEFAULT); > => INSERT 0 1 > INSERT INTO squares(num, square) VALUES (2, DEFAULT), (3, DEFAULT); > => ERROR: cannot insert into column "square" > => DETAIL: Column "square" is a generated column. Yes, this has been reported before. This is basically just not implemented. Is there a reason you need to use this form, or are you just trying things out? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services