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