From: David Fetter <da...@fetter.org>
> Please pardon me for barging in late in this discussion, but if we're
> going to be using a bulk API here, wouldn't it make more sense to use
> COPY, except where RETURNING is specified, in place of INSERT?

Please do not hesitate.  I mentioned earlier in this thread that I think INSERT 
is better because:


--------------------------------------------------
* When the user executed INSERT statements, it would look strange to the user 
if the remote SQL is displayed as COPY.

* COPY doesn't invoke rules unlike INSERT.  (I don't think the rule is a 
feature what users care about, though.)  Also, I'm a bit concerned that there 
might be, or will be, other differences between INSERT and COPY.
--------------------------------------------------


Also, COPY to foreign tables currently uses INSERTs, the improvement of using 
COPY instead of INSERT is in progress [1].  Keeping "COPY uses COPY, INSERT 
uses INSERT" correspondence seems natural, and it makes COPY's high-speed 
advantage stand out.


[1]
Fast COPY FROM command for the table with foreign partitions
https://www.postgresql.org/message-id/flat/3d0909dc-3691-a576-208a-90986e55489f%40postgrespro.ru


Regards
Takayuki Tsunakawa



Reply via email to