Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZT2v-0006l0-79 for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Dec 2018 04:01:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZT2t-0007qv-QA for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Dec 2018 04:01:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZT2t-0007qo-Gk for pgsql-bugs@lists.postgresql.org; Wed, 19 Dec 2018 04:01:19 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZT2q-0007OR-Hg for pgsql-bugs@lists.postgresql.org; Wed, 19 Dec 2018 04:01:18 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id wBJ41DIv031063; Wed, 19 Dec 2018 13:01:13 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id C26F0638CA8; Wed, 19 Dec 2018 13:01:13 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id C1069638C80; Wed, 19 Dec 2018 13:01:13 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id BBAF84005E1; Wed, 19 Dec 2018 13:01:13 +0900 (JST) Subject: Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction References: <15552-c64aa14c5c22f63c@postgresql.org> <8e82d10d-cc16-eed4-7634-3654f59d8053@lab.ntt.co.jp> <30718b48-8020-329a-c6f0-74e1222e5283@lab.ntt.co.jp> <5C18ECBB.2000507@lab.ntt.co.jp> <3539e73a-313a-5406-27c7-850affb47921@lab.ntt.co.jp> <20181219023814.GA6577@paquier.xyz> <6daa6d4a-d4a9-bd2c-0b84-c4e31d2b9844@lab.ntt.co.jp> <20181219035157.GB6577@paquier.xyz> From: Amit Langote Message-ID: <9c0508a1-da8e-b122-a3c7-61b2cbe4e10c@lab.ntt.co.jp> Date: Wed, 19 Dec 2018 13:01:01 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181219035157.GB6577@paquier.xyz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Michael Paquier Cc: Luis Carril , Etsuro Fujita , "pgsql-bugs@lists.postgresql.org" , PG Bug reporting form , Michael Paquier X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018/12/19 12:51, Michael Paquier wrote: > On Wed, Dec 19, 2018 at 11:52:09AM +0900, Amit Langote wrote: >> Hmm, note that we don't pass CopyState->freeze option to the FDW drivers >> today, though we may in the future when we add an *actual* COPY interface >> to FDWs. Wouldn't it be a good idea to prevent specifying the FREEZE >> option for foreign tables as COPY targets until then? Of course, that's >> something for -hackers to consider. > > No idea if that will happen. It may happen sooner that you may think. :) Currently, COPY into foreign tables uses APIs used by INSERT, so one row at a time interface. It'd certainly be better to allow FDWs to be able to do bulk transfer. I think Fujita-san has said he wants to work on that: https://www.postgresql.org/message-id/5AB4F190.1000804%40lab.ntt.co.jp > One argument for doing nothing yet is that > this command does not fail now so changing it may cause compatibility > problems. Just FYI, COPYing into foreign tables is only supported as of PG 11. Thanks, Amit